-
Notifications
You must be signed in to change notification settings - Fork 16
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
Use CaseInsensitiveString
for Headers
#138
Use CaseInsensitiveString
for Headers
#138
Conversation
There's currently a bug with `Headers`: if a header is created with uppercase characters, it can never be found. The problem is that we only look for lowercase characters in the `Lookup` instance for `Headers`.
In an effort to be more true to HTTP, we make the header keys case-insensitive. This fixes the issue of looking up a header where the casing is different, Since `CaseInsensitiveString`s compare in a way that ignore casing. The API for consumers for `Headers` stays the same, but we get more correct code. A win for all!
CI is broken right now, I need to fix it, so please ignore the failures... sorry about that! |
@joneshf Sweet! This is really great, thanks a bunch! Just one question, I don't think there's any value any more in making |
Sounds good to me. |
Eh, most of the tests in
Some of this is the different behavior of |
Ah, right. I'd forgotten about those differences. Thank you for checking it out! |
Sorry, this was supposed to be, "Still worth it?" |
I think that we could clean up these APIs a bit and get rid of the newtype, but I think it's out of scope for this change. So let's go ahead and merge this and I'll add a separate ticket to remove the newtype. |
Re: #136
Following the discussion in the above issue, this converts from
Object String
toMap CaseInsensitiveString String
. Let me know if anything should be done differently.Also addresses part of #113.