File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
user_guide_src/source/libraries Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -157,16 +157,19 @@ or any of the shortcut methods.
157
157
allow_redirects
158
158
===============
159
159
160
- By default, cURL will follow all "Location:" headers the remote servers send back. The `` allow_redirects `` option
161
- allows you to modify how that works.
160
+ By default, cURL will not follow any "Location:" headers the remote servers send
161
+ back. The `` allow_redirects `` option allows you to modify how that works.
162
162
163
- If you set the value to ``false ``, then it will not follow any redirects at all :
163
+ If you set the value to ``true ``, then it will follow redirects:
164
164
165
- .. literalinclude :: curlrequest/013 .php
165
+ .. literalinclude :: curlrequest/014 .php
166
166
167
- Setting it to ``true `` will apply the default settings to the request:
167
+ .. warning :: Please note that enabling redirects may redirect to a URL that you
168
+ do not expect and may enable SSRF attacks.
168
169
169
- .. literalinclude :: curlrequest/014.php
170
+ Setting it to ``false `` will apply the default settings to the request:
171
+
172
+ .. literalinclude :: curlrequest/013.php
170
173
171
174
You can pass in array as the value of the ``allow_redirects `` option to specify new settings in place of the defaults:
172
175
Original file line number Diff line number Diff line change 3
3
$ client ->request ('GET ' , 'http://example.com ' , ['allow_redirects ' => true ]);
4
4
/*
5
5
* Sets the following defaults:
6
- * 'max' => 5, // Maximum number of redirects to follow before stopping
7
- * 'strict' => true, // Ensure POST requests stay POST requests through redirects
8
- * 'protocols' => ['http', 'https'] // Restrict redirects to one or more protocols
6
+ * 'max' => 5, // Maximum number of redirects to follow before stopping
7
+ * 'strict' => true, // Ensure POST requests stay POST requests through redirects
8
+ * 'protocols' => ['http', 'https'] // Restrict redirects to one or more protocols
9
9
*/
You can’t perform that action at this time.
0 commit comments