summaryrefslogtreecommitdiff
path: root/src/http/ngx_http_upstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/ngx_http_upstream.c')
-rw-r--r--src/http/ngx_http_upstream.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 2321f6e97..4a4f8eba2 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1711,10 +1711,6 @@ ngx_http_upstream_process_header(ngx_http_request_t *r, ngx_http_upstream_t *u)
if (u->headers_in.status_n >= NGX_HTTP_SPECIAL_RESPONSE) {
- if (r->subrequest_in_memory) {
- u->buffer.last = u->buffer.pos;
- }
-
if (ngx_http_upstream_test_next(r, u) == NGX_OK) {
return;
}
@@ -3464,6 +3460,12 @@ ngx_http_upstream_finalize_request(ngx_http_request_t *r,
#endif
+ if (r->subrequest_in_memory
+ && u->headers_in.status_n >= NGX_HTTP_SPECIAL_RESPONSE)
+ {
+ u->buffer.last = u->buffer.pos;
+ }
+
if (rc == NGX_DECLINED) {
return;
}