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

Are empty header values equivalent to absent ones? #15

Closed
robhanlon22 opened this issue Feb 4, 2019 · 1 comment
Closed

Are empty header values equivalent to absent ones? #15

robhanlon22 opened this issue Feb 4, 2019 · 1 comment

Comments

@robhanlon22
Copy link
Contributor

There are a lot of falsey checks in this library rather than undefined checks. Here's one, for example. I'm wondering if these should be switched to null/undefined checks (x == null) as it appears that empty header values are valid according to the HTTP RFC. I'm wondering this is that I'm working with an API that is behaving weirdly (returns Pragma: no-cache alongside Cache-Control: ) when I send over a Cache-Control: max-age=3600 header in the request, which is causing this library to consider the response to not be cacheable. Thx!

@kornelski
Copy link
Owner

Oh, interesting edge case. I guess "header present" does include "" values, so a stricter change would be ok.

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