nginx_phantom_token_module icon indicating copy to clipboard operation
nginx_phantom_token_module copied to clipboard

Fix NGINX header_in processing so that the upstream receives all headers

Open gary-archer opened this issue 7 months ago • 0 comments

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-more source 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;
}

gary-archer avatar Apr 25 '25 18:04 gary-archer