31 janvier 2017 08:47 apl@xxxxxxxxxxxxxx a écrit:
+ } else if (BHttpRequest::IsRedirectionStatusCode(statusCode)) {
+ const BHttpHeaders responseHeaders = result.Headers();
+ const char *locationValue = responseHeaders["Location"];
+
+ if (NULL != locationValue && 0 != strlen(locationValue)) {
+ BUrl location(locationValue);
+ fprintf(stdout, "will redirect to; %s\n",
+ location.UrlString().String());
return _Download(tarGzFilePath, location, redirects + 1, 0);
- }
-
- fprintf(stdout, "unable to find 'Location' header for redirect\n");
- return B_IO_ERROR;
}