File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11The MIT License (MIT)
22
33Copyright (c) 2014-2019 British Columbia Institute of Technology
4- Copyright (c) 2019-2023 CodeIgniter Foundation
4+ Copyright (c) 2019-2024 CodeIgniter Foundation
55
66Permission is hereby granted, free of charge, to any person obtaining a copy
77of this software and associated documentation files (the "Software"), to deal
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 */
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ The MIT License (MIT)
33#####################
44
55| Copyright (c) 2014-2019 British Columbia Institute of Technology
6- | Copyright (c) 2019-2023 CodeIgniter Foundation
6+ | Copyright (c) 2019-2024 CodeIgniter Foundation
77
88Permission is hereby granted, free of charge, to any person obtaining a copy
99of this software and associated documentation files (the "Software"), to deal
You can’t perform that action at this time.
0 commit comments