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

[FIX] Capitalize headers correctly #49

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ekosz
Copy link

@ekosz ekosz commented Feb 21, 2015

This prevents duplicate headers downstream with other proxies. I was getting two status headers being returned. status and Status.

This makes rack-reverse-proxy` play nicely with others that expect headers to be capitalized.


def format_headers(headers)
headers.each_with_object({}).each do |(key, val), acc|
formated_key = key.split('-').map(&:capitalize).join('-')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code is not well tested. I have added the commit on top: waterlink/rack-reverse-proxy@ba4b9eb

@waterlink
Copy link
Contributor

Looks good

@waterlink
Copy link
Contributor

Merged here: waterlink/rack-reverse-proxy#5

bethesque pushed a commit to bethesque/rack-reverse-proxy that referenced this pull request Aug 3, 2017
suggest first middleware position in documentation
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

2 participants