summaryrefslogtreecommitdiff
path: root/service/http/response.go
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-08-28 14:56:01 +0000
committerGitHub <[email protected]>2020-08-28 14:56:01 +0000
commitfea88ad23d8686ec6ddbeb48f5cfc7b2640c036e (patch)
treee8b33245bf9b2862d43a003c8713ea07445868e6 /service/http/response.go
parent9103939fa98de53170d2bf0e8cd74529786d7ab2 (diff)
parent1911de96bea8c30293bc192e22940646f9f5a9d2 (diff)
Merge #355
355: Broken pipe issue r=48d90782 a=48d90782 - The issue with the broken pipe properly handled - superfluous response.WriteHeader issue fixed Co-authored-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'service/http/response.go')
-rw-r--r--service/http/response.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/service/http/response.go b/service/http/response.go
index 0942b3d2..f34754be 100644
--- a/service/http/response.go
+++ b/service/http/response.go
@@ -1,14 +1,16 @@
package http
import (
- json "github.com/json-iterator/go"
"io"
"net/http"
"strings"
+ json "github.com/json-iterator/go"
+
"github.com/spiral/roadrunner"
)
+
// Response handles PSR7 response logic.
type Response struct {
// Status contains response status.
@@ -57,7 +59,7 @@ func (r *Response) Write(w http.ResponseWriter) error {
if data, ok := r.body.([]byte); ok {
_, err := w.Write(data)
if err != nil {
- return err
+ return handleWriteError(err)
}
}