summaryrefslogtreecommitdiffhomepage
path: root/src/go/unit/request.go
diff options
context:
space:
mode:
authorMax Romanov <max.romanov@nginx.com>2018-04-06 16:27:46 +0300
committerMax Romanov <max.romanov@nginx.com>2018-04-06 16:27:46 +0300
commit8934afee242c1f9e33a46f4347c0a0c773590db0 (patch)
tree4ee317467ed45c2413fdbf7111ab2880cedda399 /src/go/unit/request.go
parentf6c3ef7ed3efd6f63ef55a117fe475bd369d248b (diff)
downloadunit-8934afee242c1f9e33a46f4347c0a0c773590db0.tar.gz
unit-8934afee242c1f9e33a46f4347c0a0c773590db0.tar.bz2
Go: Forced WriteHeader after application request processing.
Application should create response for every request. If not, Unit package will do it.
Diffstat (limited to 'src/go/unit/request.go')
-rw-r--r--src/go/unit/request.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/go/unit/request.go b/src/go/unit/request.go
index 4a839bdb..3d313ce2 100644
--- a/src/go/unit/request.go
+++ b/src/go/unit/request.go
@@ -46,6 +46,10 @@ func (r *request) response() *response {
}
func (r *request) done() {
+ resp := r.response()
+ if !resp.headerSent {
+ resp.WriteHeader(http.StatusOK)
+ }
C.nxt_go_request_done(r.c_req)
}