Handle everything not in [200, 300) as error. For example HockeyApp responds with 202.
This commit is contained in:
Родитель
2871326543
Коммит
f7c3207667
|
@ -338,7 +338,7 @@ bool HTTPTransportLibcurl::ExecuteSynchronously(std::string* response_body) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (status != 200) {
|
||||
if (status < 200 || status >= 300) {
|
||||
LOG(ERROR) << base::StringPrintf("HTTP status %ld", status);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -293,7 +293,7 @@ bool HTTPTransportMac::ExecuteSynchronously(std::string* response_body) {
|
|||
return false;
|
||||
}
|
||||
NSInteger http_status = [http_response statusCode];
|
||||
if (http_status != 200) {
|
||||
if (http_status < 200 || http_status >= 300) {
|
||||
LOG(ERROR) << base::StringPrintf("HTTP status %ld",
|
||||
implicit_cast<long>(http_status));
|
||||
return false;
|
||||
|
|
|
@ -369,7 +369,7 @@ bool HTTPTransportWin::ExecuteSynchronously(std::string* response_body) {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (status_code != 200) {
|
||||
if (status_code < 200 || status_code >= 300) {
|
||||
LOG(ERROR) << base::StringPrintf("HTTP status %d", status_code);
|
||||
return false;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче