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

Headers_in and Headers_out returns wrong value in some case #471

Closed
yano3 opened this issue Aug 16, 2020 · 0 comments · Fixed by #472
Closed

Headers_in and Headers_out returns wrong value in some case #471

yano3 opened this issue Aug 16, 2020 · 0 comments · Fixed by #472

Comments

@yano3
Copy link
Contributor

yano3 commented Aug 16, 2020

When there are multiple headers where one name contains the other (e.g. X-HOGE and X-HOGE-FUGA), Headers_in, Headers_out returns wrong value.

Reproduce

server {
    listen       80;
    server_name  localhost;

    location / {
        mruby_content_handler_code '
          hin = Nginx::Headers_in.new
          Nginx.echo hin["X-HOGE"]
          Nginx.echo hin["X-HOGE-FUGA"]
        ';
    }
}
$ curl -H "X-HOGE: hoge" -H "X-HOGE-FUGA: fuga" http://localhost:10080/index.html
["hoge", "fuga"]
fuga

In the above example, Nginx.echo hin["X-HOGE"] is expected to return only hoge.

yyamano added a commit to yyamano/ngx_mruby that referenced this issue Aug 16, 2020
matsumotory added a commit that referenced this issue Aug 18, 2020
Fix Nginx::Headers_in[] returns wrong value. Fixed #471.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant