\Request and relative 301 location #7799
Comments
Is this issue still relevant? |
Not for my project, but maybe for the future ? It´s your choice ;-) |
Ok, can you explain the problem to me again please? :) |
example code :
sitemap from heise.de, one entry, for example :
response is a 301. adding redirect option into request :
results in 301 too. This happens cause this line : https://github.com/contao/core/blob/master/system/modules/core/library/Contao/Request.php#L433 The Location in the ResponseHeader has only a relative URL : /newsticker/meldung/Kunstprojekt-Random-Darknet-Shopper-geht-wieder-auf-Einkaufstour-3024099.html Now the $uri (https://github.com/contao/core/blob/master/system/modules/core/library/Contao/Request.php#L271) is in the second step only :
and without any scheme, the response and everything else stay with old values (https://github.com/contao/core/blob/master/system/modules/core/library/Contao/Request.php#L287) --> http error 301 I think, it will be sufficient, in generating an asolute URL based on the request header and the response location, if the response location is an relative URL. |
I definitely want to fix this! :) |
Fixed in 6d12f6b. |
Requesting entries from a sitemap http://www.heise.de/sitemap.xml
Those entries are redirected to a relative URL, which is wrong handled by the Request::send function
Array
(
[scheme] => http
[host] => www.heise.de
[path] => /meldung/Hickhack-um-Virtual-Reality-Apps-fuer-Samsungs-Gear-VR-2631443.html
)
Redirect goes to :
Array
(
[path] => /newsticker/meldung/Hickhack-um-Virtual-Reality-Apps-fuer-Samsungs-Gear-VR-2631443.html
)
that means, the redirect here (https://github.com/contao/core/blob/master/system/modules/core/library/Contao/Request.php#L443) has to check, if scheme, host, port exists and rebuild the URL
The text was updated successfully, but these errors were encountered: