From 0198df5962dd94a39dba6c5352c7c14c0bfa7ad8 Mon Sep 17 00:00:00 2001 From: JustSong Date: Tue, 25 Apr 2023 10:47:25 +0800 Subject: [PATCH] fix: only keep header Authorization & Content-Type --- controller/relay.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/controller/relay.go b/controller/relay.go index a8a9ed2fd8..ef058d53e5 100644 --- a/controller/relay.go +++ b/controller/relay.go @@ -24,12 +24,12 @@ func Relay(c *gin.Context) { }) return } - req.Header = c.Request.Header.Clone() + //req.Header = c.Request.Header.Clone() // Fix HTTP Decompression failed // https://github.com/stoplightio/prism/issues/1064#issuecomment-824682360 - req.Header.Del("Accept-Encoding") - // Fix http2: invalid Connection request header: ["upgrade"] - req.Header.Del("Upgrade") + //req.Header.Del("Accept-Encoding") + req.Header.Set("Authorization", c.Request.Header.Get("Authorization")) + req.Header.Set("Content-Type", c.Request.Header.Get("Content-Type")) client := &http.Client{} resp, err := client.Do(req)