mirror of
https://github.com/klzgrad/naiveproxy.git
synced 2025-04-07 07:43:38 +03: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;
|
||||
sanitized_headers.RemoveHeader(HttpRequestHeaders::kProxyConnection);
|
||||
sanitized_headers.RemoveHeader(HttpRequestHeaders::kProxyAuthorization);
|
||||
std::stringstream ss;
|
||||
ss << buffer_.substr(0, first_line_end);
|
||||
ss << "\r\n";
|
||||
|
||||
std::ostringstream ss;
|
||||
ss << buffer_.substr(0, first_line_end) << "\r\n";
|
||||
ss << sanitized_headers.ToString();
|
||||
ss << "\r\n";
|
||||
ss << "\r\n";
|
||||
ss << buffer_.substr(header_end + 4);
|
||||
if (buffer_.size() > header_end + 4) {
|
||||
ss << buffer_.substr(header_end + 4);
|
||||
}
|
||||
buffer_ = ss.str();
|
||||
// Skip padding write for raw http proxy
|
||||
completed_handshake_ = true;
|
||||
|
|
Loading…
Add table
Reference in a new issue