summaryrefslogtreecommitdiff
path: root/src/HttpResponse.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2014-02-05 21:20:09 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2014-02-05 21:20:09 +0900
commitb18e62dba74f75f89aab830dd961af231da06119 (patch)
treea91a274723c8400b05be2c8d71a45d8a634053f1 /src/HttpResponse.cc
parentec4b7297047ec181860049d66e71c03317f1fdc3 (diff)
Treat 30X response without Location header field as error
This is required to make segmented download work.
Diffstat (limited to 'src/HttpResponse.cc')
-rw-r--r--src/HttpResponse.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/HttpResponse.cc b/src/HttpResponse.cc
index 27eb500f..dae61dc3 100644
--- a/src/HttpResponse.cc
+++ b/src/HttpResponse.cc
@@ -105,6 +105,10 @@ void HttpResponse::validateResponse() const
case 303: // See Other
case 307: // Temporary Redirect
case 308: // Permanent Redirect
+ if (!httpHeader_->defined(HttpHeader::LOCATION)) {
+ throw DL_ABORT_EX2(fmt(EX_LOCATION_HEADER_REQUIRED, statusCode),
+ error_code::HTTP_PROTOCOL_ERROR);
+ }
return;
}
if (statusCode >= 400) {