Commit a8eacd33 by JustSong

fix: relay more headers

parent e8066d9b
......@@ -30,6 +30,18 @@ func Relay(c *gin.Context) {
//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"))
acceptHeader := c.Request.Header.Get("Accept")
if acceptHeader != "" {
req.Header.Set("Accept", acceptHeader)
}
connectionHeader := c.Request.Header.Get("Connection")
if connectionHeader != "" {
req.Header.Set("Connection", connectionHeader)
}
lastEventIDHeader := c.Request.Header.Get("Last-Event-ID")
if lastEventIDHeader != "" {
req.Header.Set("Last-Event-ID", lastEventIDHeader)
}
client := &http.Client{}
resp, err := client.Do(req)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment