mirror of
https://github.com/nginx/nginx.git
synced 2026-10-24 04:52:25 +00:00
Upstream: fix $upstream_status variable.
Previously, upstream's status code was overwritten with cached response's status code when STALE or REVALIDATED response was sent to the client. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
This commit is contained in:
parent
cd358e5a95
commit
60d508ceb9
4 changed files with 6 additions and 6 deletions
|
|
@ -1584,7 +1584,7 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
|
|||
ngx_str_set(&u->headers_in.status_line, "200 OK");
|
||||
}
|
||||
|
||||
if (u->state) {
|
||||
if (u->state && u->state->status == 0) {
|
||||
u->state->status = u->headers_in.status_n;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1362,7 +1362,7 @@ ngx_http_proxy_process_status_line(ngx_http_request_t *r)
|
|||
return NGX_OK;
|
||||
}
|
||||
|
||||
if (u->state) {
|
||||
if (u->state && u->state->status == 0) {
|
||||
u->state->status = ctx->status.code;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -885,7 +885,7 @@ ngx_http_scgi_process_status_line(ngx_http_request_t *r)
|
|||
return ngx_http_scgi_process_header(r);
|
||||
}
|
||||
|
||||
if (u->state) {
|
||||
if (u->state && u->state->status == 0) {
|
||||
u->state->status = status->code;
|
||||
}
|
||||
|
||||
|
|
@ -1013,7 +1013,7 @@ ngx_http_scgi_process_header(ngx_http_request_t *r)
|
|||
ngx_str_set(&u->headers_in.status_line, "200 OK");
|
||||
}
|
||||
|
||||
if (u->state) {
|
||||
if (u->state && u->state->status == 0) {
|
||||
u->state->status = u->headers_in.status_n;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1017,7 +1017,7 @@ ngx_http_uwsgi_process_status_line(ngx_http_request_t *r)
|
|||
return ngx_http_uwsgi_process_header(r);
|
||||
}
|
||||
|
||||
if (u->state) {
|
||||
if (u->state && u->state->status == 0) {
|
||||
u->state->status = status->code;
|
||||
}
|
||||
|
||||
|
|
@ -1145,7 +1145,7 @@ ngx_http_uwsgi_process_header(ngx_http_request_t *r)
|
|||
ngx_str_set(&u->headers_in.status_line, "200 OK");
|
||||
}
|
||||
|
||||
if (u->state) {
|
||||
if (u->state && u->state->status == 0) {
|
||||
u->state->status = u->headers_in.status_n;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue