http2 support for plain http requests

This commit is contained in:
Vladislav Yarmak 2020-05-24 15:59:11 +03:00
parent a7019513e0
commit 893c0efcf2
1 changed files with 4 additions and 0 deletions

View File

@ -66,6 +66,10 @@ func (s *ProxyHandler) HandleTunnel(wr http.ResponseWriter, req *http.Request) {
func (s *ProxyHandler) HandleRequest(wr http.ResponseWriter, req *http.Request) { func (s *ProxyHandler) HandleRequest(wr http.ResponseWriter, req *http.Request) {
req.RequestURI = "" req.RequestURI = ""
if req.ProtoMajor == 2 {
req.URL.Scheme = "http" // We can't access :scheme pseudo-header, so assume http
req.URL.Host = req.Host
}
resp, err := s.httptransport.RoundTrip(req) resp, err := s.httptransport.RoundTrip(req)
if err != nil { if err != nil {
s.logger.Error("HTTP fetch error: %v", err) s.logger.Error("HTTP fetch error: %v", err)