Преглед на файлове

force http2 server to send back plain encoding.

Darien Raymond преди 7 години
родител
ревизия
a7103481d5
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      transport/internet/http/dialer.go

+ 4 - 0
transport/internet/http/dialer.go

@@ -97,7 +97,11 @@ func Dial(ctx context.Context, dest net.Destination) (internet.Connection, error
 		Proto:      "HTTP/2",
 		ProtoMajor: 2,
 		ProtoMinor: 0,
+		Header:     make(http.Header),
 	}
+	// Disable any compression method from server.
+	request.Header.Set("Accept-Encoding", "identity")
+
 	response, err := client.Do(request)
 	if err != nil {
 		return nil, newError("failed to dial to ", dest).Base(err).AtWarning()