Loading src/http.cpp +15 −1 Original line number Diff line number Diff line Loading @@ -3464,7 +3464,17 @@ libhttppp::HttpResponse::HttpResponse() : HttpHeader(){ _TransferEncoding=nullptr; } libhttppp::HttpResponse::HttpResponse(const HttpResponse &src) : HttpResponse(){ libhttppp::HttpResponse::HttpResponse(const HttpResponse &src) : HttpHeader(){ // Deliberately does NOT delegate to HttpResponse() -- that default ctor // unconditionally seeds "content-length: 0"/"connection: keep-alive" // placeholders and leaves _ContentType null, on the assumption a fresh // response is about to be built up via the setters below. Delegating to // it here meant copying a source that defines its own Content-Length or // Connection appended a second value onto that placeholder's HeaderData // instead of replacing it, and _ContentType was never pointed at the // copy's own copied node at all -- getContentType() on any copied // HttpResponse (e.g. HttpClient::_lastResponse, see _h1ReadResponse) // returned "" even when the header list it held had the real value. _State = src._State; _Version = src._Version; _StatusCode = src._StatusCode; Loading @@ -3474,6 +3484,10 @@ libhttppp::HttpResponse::HttpResponse(const HttpResponse &src) : HttpResponse(){ newdat->push_back(curval->getvalue()); } } _ContentLength = getHeaderData("content-length"); _Connection = getHeaderData("connection"); _ContentType = getHeaderData("content-type"); _TransferEncoding = getHeaderData("transfer-encoding"); } void libhttppp::HttpResponse::setState(const std ::string &httpstate){ Loading Loading
src/http.cpp +15 −1 Original line number Diff line number Diff line Loading @@ -3464,7 +3464,17 @@ libhttppp::HttpResponse::HttpResponse() : HttpHeader(){ _TransferEncoding=nullptr; } libhttppp::HttpResponse::HttpResponse(const HttpResponse &src) : HttpResponse(){ libhttppp::HttpResponse::HttpResponse(const HttpResponse &src) : HttpHeader(){ // Deliberately does NOT delegate to HttpResponse() -- that default ctor // unconditionally seeds "content-length: 0"/"connection: keep-alive" // placeholders and leaves _ContentType null, on the assumption a fresh // response is about to be built up via the setters below. Delegating to // it here meant copying a source that defines its own Content-Length or // Connection appended a second value onto that placeholder's HeaderData // instead of replacing it, and _ContentType was never pointed at the // copy's own copied node at all -- getContentType() on any copied // HttpResponse (e.g. HttpClient::_lastResponse, see _h1ReadResponse) // returned "" even when the header list it held had the real value. _State = src._State; _Version = src._Version; _StatusCode = src._StatusCode; Loading @@ -3474,6 +3484,10 @@ libhttppp::HttpResponse::HttpResponse(const HttpResponse &src) : HttpResponse(){ newdat->push_back(curval->getvalue()); } } _ContentLength = getHeaderData("content-length"); _Connection = getHeaderData("connection"); _ContentType = getHeaderData("content-type"); _TransferEncoding = getHeaderData("transfer-encoding"); } void libhttppp::HttpResponse::setState(const std ::string &httpstate){ Loading