Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nghttpx: In mruby, the first header is always deleted on every call to env.req.set_header(...) #1119

Closed
dylanplecki opened this issue Jan 27, 2018 · 0 comments · Fixed by #1120

Comments

@dylanplecki
Copy link
Contributor

A bug in the nghttpx mruby code has been stripping all of our HTTP/2 request headers when a certain mruby script was enabled. This script called env.req.set_header("HEADER", "") multiple (10+ times) in order to strip-away insecure headers before passing the request internally. The bug that we observed was that all headers were being stripped away, regardless of whether they were in a set_header directive or not.

The offending bug is in the src/shrpx_mruby_module_request.cc file, in the request_mod_header function, and only occurs when repl == true. This is due to a simple logic error in the header replacement code, which will always truncate the headers list by removing the first header.

A pull request with the fix is ready and will be attached momentarily.

dylanplecki added a commit to dylanplecki/nghttp2 that referenced this issue Jan 27, 2018
@tatsuhiro-t tatsuhiro-t added this to the v1.30.0 milestone Jan 28, 2018
tatsuhiro-t added a commit that referenced this issue Jan 28, 2018
…rwrite

Fix #1119: Overwrite of first header on mruby call to env.req.set_header(..)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants