From de556004c7e3685255982ca901ca4b953163f40d Mon Sep 17 00:00:00 2001 From: klzgrad Date: Mon, 10 Dec 2018 02:20:16 -0500 Subject: [PATCH] http: Add padding for CONNECT requests --- src/net/http/proxy_client_socket.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/net/http/proxy_client_socket.cc b/src/net/http/proxy_client_socket.cc index 6dde1d57f0..5323deca4c 100644 --- a/src/net/http/proxy_client_socket.cc +++ b/src/net/http/proxy_client_socket.cc @@ -7,6 +7,7 @@ #include #include "base/metrics/histogram_macros.h" +#include "base/rand_util.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "net/base/host_port_pair.h" @@ -42,6 +43,8 @@ void ProxyClientSocket::BuildTunnelRequest( request_headers->SetHeader(HttpRequestHeaders::kUserAgent, user_agent); request_headers->MergeFrom(extra_headers); + request_headers->SetHeader("Padding", + std::string(base::RandInt(16, 32), '.')); } // static