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 work with nginx #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ahawkins
Copy link

This fixes a big problem with nginx. nginx does not send some headers if they have an underscore in them. Since this is a Rack middleware, all headers will be converted into HTTP_FOO_BAR. The original header may have been Foo-Bar or Foo_Bar. We may never know. Actually is a very annoying problem with rack because you can't access the original headers. So, we simply replace _'s with - and everything is cool. Most likely the _'s were -'s in the first place.

This fixes a big problem with nginx. nginx does not send some headers if they have an underscore in them. Since this is a Rack middleware, all headers will be converted into HTTP_FOO_BAR. The original header may have been Foo-Bar or Foo_Bar. We may never know. Actually is a very annoying problem with rack because you can't access the original headers. So, we simply replace `_`'s with `-` and everything is cool. Most likely the `_`'s were `-`'s in the first place.
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 this pull request may close these issues.

None yet

1 participant