more_clear_input_header and more_set_input_header on subrequest will result in assert
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 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 Thanks for the response. The ngx_lua behavior seem correct.
Just hit this issue when attempting to use more_clear_input_headers in a subrequest, thanks for your breakdown @usirsiwal.
I think we can just disable these directives in the context of subrequests for now.