headers-more-nginx-module icon indicating copy to clipboard operation
headers-more-nginx-module copied to clipboard

more_clear_input_header and more_set_input_header on subrequest will result in assert

Open usirsiwal opened this issue 10 years ago • 4 comments

In https://github.com/agentzh/headers-more-nginx-module/commit/1caf5cc413d0d0196eff2c550f2fcc6a710e180e

an assert was added to catch headers_in linked list corruption.

However, look at http://hg.nginx.org/nginx/file/4a71ef1aa36d/src/http/ngx_http_core_module.c#l2476

this means the assert will always trigger when operating on subrequests.

It seems to me use of more_XX_input_headers on a subrequest is fundamentally unsafe unless we copy all the input headers to a new array when the more_XXX_input_headers is invoked.

usirsiwal avatar Dec 05 '13 19:12 usirsiwal

@usirsiwal Yes, you're right. And copying all the request headers to the subrequest is exactly what the latest ngx_lua git master does in its subrequest API.

agentzh avatar Dec 05 '13 20:12 agentzh

@agentzh Thanks for the response. The ngx_lua behavior seem correct.

usirsiwal avatar Dec 05 '13 21:12 usirsiwal

Just hit this issue when attempting to use more_clear_input_headers in a subrequest, thanks for your breakdown @usirsiwal.

davidjb avatar Jul 13 '16 02:07 davidjb

I think we can just disable these directives in the context of subrequests for now.

agentzh avatar Jul 14 '16 16:07 agentzh