diff options
Diffstat (limited to 'src/HttpResponseCommand.cc')
| -rw-r--r-- | src/HttpResponseCommand.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/HttpResponseCommand.cc b/src/HttpResponseCommand.cc index 780209a4..e85a0329 100644 --- a/src/HttpResponseCommand.cc +++ b/src/HttpResponseCommand.cc @@ -239,9 +239,11 @@ bool HttpResponseCommand::executeInternal() if(getFileEntry()->isUniqueProtocol()) { // Redirection should be considered here. We need to parse // original URI to get hostname. - uri::UriStruct us; - if(uri::parse(us, getRequest()->getUri())) { - getFileEntry()->removeURIWhoseHostnameIs(us.host); + const std::string& uri = getRequest()->getUri(); + uri_split_result us; + if(uri_split(&us, uri.c_str()) == 0) { + std::string host = uri::getFieldString(us, USR_HOST, uri.c_str()); + getFileEntry()->removeURIWhoseHostnameIs(host); } } if(!getPieceStorage()) { |
