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.
157157allow_redirects
158158===============
159159
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.
162162
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:
164164
165- .. literalinclude :: curlrequest/013 .php
165+ .. literalinclude :: curlrequest/014 .php
166166
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.
168169
169- .. literalinclude :: curlrequest/014.php
170+ Setting it to ``false `` will apply the default settings to the request:
171+
172+ .. literalinclude :: curlrequest/013.php
170173
171174You can pass in array as the value of the ``allow_redirects `` option to specify new settings in place of the defaults:
172175
Original file line number Diff line number Diff line change 33$ client ->request ('GET ' , 'http://example.com ' , ['allow_redirects ' => true ]);
44/*
55 * 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
99 */
You can’t perform that action at this time.
0 commit comments