nginx_phantom_token_module
nginx_phantom_token_module copied to clipboard
Fix NGINX header_in processing so that the upstream receives all headers
This originated from the reported issue so we added some tests to reproduce the issue and then adopted the suggested approach:
- Since this adds quite a bit more code, we moved to a multi-source file module.
- Use a
headers-moresource file to deal with low-level header handling, to update buffers / nelts etc. - Also, the pull request includes some associated error handling and tests.
The approach all seems logical, since tests failed until we added the headers-more logic. However, I would like to be able to justify the following logic with another module as a reference:
if (r->headers_in.headers.part.next == NULL) {
r->headers_in.headers.part.nelts = r->headers_in.headers.last->nelts;
}