comparison src/http/modules/ngx_http_auth_basic_module.c @ 8031:d26db4f82d7d

All known output headers can be linked lists now. The h->next pointer properly provided as NULL in all cases where known output headers are added. Note that there are 3rd party modules which might not do this, and it might be risky to rely on this for arbitrary headers.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 30 May 2022 21:25:45 +0300
parents be82e72c9af8
children
comparison
equal deleted inserted replaced
8030:cdc2724858ca 8031:d26db4f82d7d
337 p = ngx_cpymem(basic, "Basic realm=\"", sizeof("Basic realm=\"") - 1); 337 p = ngx_cpymem(basic, "Basic realm=\"", sizeof("Basic realm=\"") - 1);
338 p = ngx_cpymem(p, realm->data, realm->len); 338 p = ngx_cpymem(p, realm->data, realm->len);
339 *p = '"'; 339 *p = '"';
340 340
341 r->headers_out.www_authenticate->hash = 1; 341 r->headers_out.www_authenticate->hash = 1;
342 r->headers_out.www_authenticate->next = NULL;
342 ngx_str_set(&r->headers_out.www_authenticate->key, "WWW-Authenticate"); 343 ngx_str_set(&r->headers_out.www_authenticate->key, "WWW-Authenticate");
343 r->headers_out.www_authenticate->value.data = basic; 344 r->headers_out.www_authenticate->value.data = basic;
344 r->headers_out.www_authenticate->value.len = len; 345 r->headers_out.www_authenticate->value.len = len;
345 346
346 return NGX_HTTP_UNAUTHORIZED; 347 return NGX_HTTP_UNAUTHORIZED;