note 125832 added to context.http
| From: | ASchmidt at Anamera dot net | Date: | Tue, 16 Feb 2021 14:51:34 +0000 |
| Subject: | note 125832 added to context.http | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219276@lists.php.net to get a copy of this message | ||
With the default of
'follow_location' => 1
be certain NEVER include a "Host:" header in the 'header' array.
If the host is set to "mydomain.com", and that web site has a (quite common) redirect to
"www.mydomain.com", then the initial request to "http://mydomain.com" will get the expected response of:
HTTP/1.1 301 Moved Permanently
Location: http://www.mydomain.com/
However, the follow-up request does NOT replace the original "host" header with the new
"location" value, as one would expect. Consequently each "follow-location"
request will again be served by the original host of "http://mydomain.com", and continue the redirect loop
until 'max_redirects' has been exhausted.
(For details: https://bugs.php.net/bug.php?id=77889)
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.247 (proxied: 206.128.157.247)
----
Manual Page -- http://php.net/manual/en/context.http.php
Edit -- https://master.php.net/note/edit/125832
Del: integrated -- https://master.php.net/note/delete/125832/integrated
Del: useless -- https://master.php.net/note/delete/125832/useless
Del: bad code -- https://master.php.net/note/delete/125832/bad+code
Del: spam -- https://master.php.net/note/delete/125832/spam
Del: non-english -- https://master.php.net/note/delete/125832/non-english
Del: in docs -- https://master.php.net/note/delete/125832/in+docs
Del: other reasons-- https://master.php.net/note/delete/125832
Reject -- https://master.php.net/note/reject/125832
Search -- https://master.php.net/manage/user-notes.php