aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_auth_request_module.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/modules/ngx_http_auth_request_module.c')
-rw-r--r--src/http/modules/ngx_http_auth_request_module.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/http/modules/ngx_http_auth_request_module.c b/src/http/modules/ngx_http_auth_request_module.c
index bab79e496..8bc98aae6 100644
--- a/src/http/modules/ngx_http_auth_request_module.c
+++ b/src/http/modules/ngx_http_auth_request_module.c
@@ -101,7 +101,7 @@ ngx_module_t ngx_http_auth_request_module = {
static ngx_int_t
ngx_http_auth_request_handler(ngx_http_request_t *r)
{
- ngx_table_elt_t *h, *ho;
+ ngx_table_elt_t *h, *ho, **ph;
ngx_http_request_t *sr;
ngx_http_post_subrequest_t *ps;
ngx_http_auth_request_ctx_t *ctx;
@@ -147,15 +147,21 @@ ngx_http_auth_request_handler(ngx_http_request_t *r)
h = sr->upstream->headers_in.www_authenticate;
}
- if (h) {
+ ph = &r->headers_out.www_authenticate;
+
+ while (h) {
ho = ngx_list_push(&r->headers_out.headers);
if (ho == NULL) {
return NGX_ERROR;
}
*ho = *h;
+ ho->next = NULL;
+
+ *ph = ho;
+ ph = &ho->next;
- r->headers_out.www_authenticate = ho;
+ h = h->next;
}
return ctx->status;