HttpRequest: handle 302 and 307 redirects.
* Makes jamendo.com player work, as their soundfiles are behind a temporary redirect for load balancing.
This commit is contained in:
parent
d946ade025
commit
a8d8e823ea
|
@ -321,8 +321,11 @@ BHttpRequest::_ProtocolLoop()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// TODO: Some browsers seems to translate POST requests to
|
// TODO: Some browsers seems to translate POST requests to
|
||||||
// GET when following a 302 redirection
|
// GET when following a 302 redirection. 303 should do the same,
|
||||||
if (fResult.StatusCode() == B_HTTP_STATUS_MOVED_PERMANENTLY) {
|
// but NOT 307.
|
||||||
|
if (fResult.StatusCode() == B_HTTP_STATUS_MOVED_PERMANENTLY
|
||||||
|
|| fResult.StatusCode() == B_HTTP_STATUS_TEMPORARY_REDIRECT
|
||||||
|
|| fResult.StatusCode() == B_HTTP_STATUS_FOUND) {
|
||||||
BString locationUrl = fHeaders["Location"];
|
BString locationUrl = fHeaders["Location"];
|
||||||
|
|
||||||
fUrl = BUrl(fUrl, locationUrl);
|
fUrl = BUrl(fUrl, locationUrl);
|
||||||
|
|
Loading…
Reference in New Issue