Plugins: Only set non-existing headers for core plugin requests (#78633)
* Only set non-existing headers - Add test scenario * Fix test
This commit is contained in:
@@ -50,7 +50,10 @@ func (m *HTTPClientMiddleware) applyHeaders(ctx context.Context, pReq any) conte
|
||||
|
||||
if h, ok := pReq.(backend.ForwardHTTPHeaders); ok {
|
||||
for k, v := range h.GetHTTPHeaders() {
|
||||
req.Header[k] = v
|
||||
// Only set a header if it is not already set.
|
||||
if req.Header.Get(k) == "" {
|
||||
req.Header[k] = v
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user