improve outline api with error handling and proper content-type response

This commit is contained in:
Kevin Pham
2023-11-29 09:50:02 -06:00
parent e5bd5df2c0
commit 909d29230f
8 changed files with 405 additions and 191 deletions

View File

@@ -487,9 +487,11 @@ func (chain *ProxyChain) Execute() error {
}
// in case api user did not set or forward content-type, we do it for them
if chain.Context.Get("content-type") == "" {
chain.Context.Set("content-type", chain.Response.Header.Get("content-type"))
}
/*
if chain.Context.Get("content-type") == "" {
chain.Context.Set("content-type", chain.Response.Header.Get("content-type"))
}
*/
// Return request back to client
return chain.Context.SendStream(body)