summaryrefslogtreecommitdiff
path: root/src/HttpResponseCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2014-02-05 00:32:08 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2014-02-05 00:32:43 +0900
commitec4b7297047ec181860049d66e71c03317f1fdc3 (patch)
tree169b905fff6314126bd6113bea1c7021a69719c0 /src/HttpResponseCommand.cc
parentbdc9c8a991166f74d152128be347127deabcad92 (diff)
Better handling of 30X HTTP status codes
Reference: http://greenbytes.de/tech/tc/httpredirects/
Diffstat (limited to 'src/HttpResponseCommand.cc')
-rw-r--r--src/HttpResponseCommand.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc
index 4c047a27..622736d3 100644
--- a/src/HttpResponseCommand.cc
+++ b/src/HttpResponseCommand.cc
@@ -231,10 +231,11 @@ bool HttpResponseCommand::executeInternal()
#endif // ENABLE_MESSAGE_DIGEST
}
- if (statusCode >= 300) {
- if (statusCode == 404) {
- grp->increaseAndValidateFileNotFoundCount();
- }
+ if (statusCode == 404) {
+ grp->increaseAndValidateFileNotFoundCount();
+ return skipResponseBody(std::move(httpResponse));
+ }
+ if (statusCode >= 400 || statusCode == 304 || httpResponse->isRedirect()) {
return skipResponseBody(std::move(httpResponse));
}