Skip to content

Commit

Permalink
fix: only keep header Authorization & Content-Type
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed Apr 25, 2023
1 parent 4c0dc50 commit 0198df5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions controller/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0198df5

Please sign in to comment.