We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 00a6b15 commit 14b009aCopy full SHA for 14b009a
proxy.go
@@ -90,13 +90,18 @@ func (p *proxy) do(writer http.ResponseWriter, request *http.Request) {
90
}
91
defer resp.Body.Close()
92
93
- writer.WriteHeader(resp.StatusCode)
94
for key, values := range resp.Header {
95
for _, value := range values {
96
writer.Header().Add(key, value)
97
98
99
- _, _ = io.Copy(writer, resp.Body)
+ writer.WriteHeader(resp.StatusCode)
+
100
+ _, err = io.Copy(writer, resp.Body)
101
+ if err != nil {
102
+ http.Error(writer, err.Error(), http.StatusInternalServerError)
103
+ return
104
+ }
105
106
107
func (p *proxy) proxyMatchTarget(path string, writer http.ResponseWriter, request *http.Request) {
0 commit comments