mirror of
https://github.com/traefik/traefik.git
synced 2026-06-18 19:38:23 +03:00
Trim quotes from proxy_set_header header name
This commit is contained in:
@@ -393,7 +393,7 @@ func createProxySetHeaderAction(d config.IDirective) (action, error) {
|
||||
return nil, errors.New("proxy_set_header directive requires 2 parameters (header and value)")
|
||||
}
|
||||
|
||||
key := params[0].String()
|
||||
key := trimQuote(params[0].String())
|
||||
val := trimQuote(params[1].String())
|
||||
|
||||
return func(rw http.ResponseWriter, req *http.Request, ctx *actionContext) (bool, error) {
|
||||
|
||||
@@ -399,6 +399,15 @@ proxy_set_header Accept-Encoding "";
|
||||
"Accept-Encoding",
|
||||
},
|
||||
},
|
||||
{
|
||||
desc: "proxy_set_header with quoted header name",
|
||||
configurationSnippet: `
|
||||
proxy_set_header "X-Custom-Header" "my-value";
|
||||
`,
|
||||
expectedRequestHeaders: map[string]string{
|
||||
"X-Custom-Header": "my-value",
|
||||
},
|
||||
},
|
||||
{
|
||||
desc: "set directive creates variable",
|
||||
configurationSnippet: `
|
||||
|
||||
Reference in New Issue
Block a user