Plugins: Refactor call resource API handling (#67234)
Moving call resource API stream handling within plugin management as a utility/wrapper. Closes #66889 Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
This commit is contained in:
co-authored by
Will Browne
parent
b5fbce50b3
commit
4cbda914bd
@@ -34,6 +34,10 @@ func (m *ResourceResponseMiddleware) CallResource(ctx context.Context, req *back
|
||||
processedStreams := 0
|
||||
wrappedSender := callResourceResponseSenderFunc(func(res *backend.CallResourceResponse) error {
|
||||
if processedStreams == 0 {
|
||||
if res.Headers == nil {
|
||||
res.Headers = map[string][]string{}
|
||||
}
|
||||
|
||||
proxyutil.SetProxyResponseHeaders(res.Headers)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user