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

Why header keys are downcased? #143

Open
xliiauo opened this issue Aug 7, 2017 · 1 comment
Open

Why header keys are downcased? #143

xliiauo opened this issue Aug 7, 2017 · 1 comment

Comments

@xliiauo
Copy link

xliiauo commented Aug 7, 2017

Hi, I was trying to test out the response headers. And the response header is something like "X-TV-subscriptionId": "12345678", and I tried to expect_header "X-TV-subscriptionId", "12345678" and it returns false, it will return true only if I do expect_header "x_tv_subscriptionid", "12345678".

Wondering is this behaviour intended? As headers are case sensitives anyway, case switch is not an issue for me. But converting hyphen into underscore is breaking my test.

Many thanks in advance.

Update: looks like even expect_header :X_tv_subscriptionid, "12345678" will return a false? The downscore is not working?

@rdalverny
Copy link
Contributor

Yes, this is expected (downcase, underscore instead of hyphen). This is tied to rest-client implementation:

Plus, airborne uses an indifferent access hash, so you may use a string or a symbol as a key.

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

No branches or pull requests

2 participants