mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2025-04-14 06:30:57 +00:00
naive: fix malformed http 1.0 request
HttpRequestHeaders::ToString not only has CRLR for every header, but also has the trailing CRLR. It might affect POST/PUT methods.
This commit is contained in:
parent
4b250049af
commit
c24f5343e9
1 changed files with 6 additions and 6 deletions
|
@ -379,13 +379,13 @@ int HttpProxyServerSocket::DoHeaderReadComplete(int result) {
|
||||||
HttpRequestHeaders sanitized_headers = headers;
|
HttpRequestHeaders sanitized_headers = headers;
|
||||||
sanitized_headers.RemoveHeader(HttpRequestHeaders::kProxyConnection);
|
sanitized_headers.RemoveHeader(HttpRequestHeaders::kProxyConnection);
|
||||||
sanitized_headers.RemoveHeader(HttpRequestHeaders::kProxyAuthorization);
|
sanitized_headers.RemoveHeader(HttpRequestHeaders::kProxyAuthorization);
|
||||||
std::stringstream ss;
|
|
||||||
ss << buffer_.substr(0, first_line_end);
|
std::ostringstream ss;
|
||||||
ss << "\r\n";
|
ss << buffer_.substr(0, first_line_end) << "\r\n";
|
||||||
ss << sanitized_headers.ToString();
|
ss << sanitized_headers.ToString();
|
||||||
ss << "\r\n";
|
if (buffer_.size() > header_end + 4) {
|
||||||
ss << "\r\n";
|
ss << buffer_.substr(header_end + 4);
|
||||||
ss << buffer_.substr(header_end + 4);
|
}
|
||||||
buffer_ = ss.str();
|
buffer_ = ss.str();
|
||||||
// Skip padding write for raw http proxy
|
// Skip padding write for raw http proxy
|
||||||
completed_handshake_ = true;
|
completed_handshake_ = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue