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:
Adrien Destugues
2014-04-10 08:50:59 +02:00
parent d946ade025
commit a8d8e823ea
+5 -2
View File
@@ -321,8 +321,11 @@ BHttpRequest::_ProtocolLoop()
break;
// TODO: Some browsers seems to translate POST requests to
// GET when following a 302 redirection
if (fResult.StatusCode() == B_HTTP_STATUS_MOVED_PERMANENTLY) {
// GET when following a 302 redirection. 303 should do the same,
// 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"];
fUrl = BUrl(fUrl, locationUrl);