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

Header type equality comparison #1418

Closed
psibi opened this Issue Jul 13, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@psibi
Member

psibi commented Jul 13, 2017

The equality comparison is case insensitive according to the HTTP specs. Right now, we don't make that distinction.

@snoyberg

This comment has been minimized.

Show comment
Hide comment
@snoyberg

snoyberg Jul 13, 2017

Member

Header keys are wrapped in the CI type constructor, which ensures a case insensitive comparison. Is there a specific counterexample?

Member

snoyberg commented Jul 13, 2017

Header keys are wrapped in the CI type constructor, which ensures a case insensitive comparison. Is there a specific counterexample?

@psibi

This comment has been minimized.

Show comment
Hide comment
Member

psibi commented Jul 13, 2017

@snoyberg I think this Header is not wrapped in CI type constructor: https://www.stackage.org/haddock/lts-8.22/yesod-core-1.4.35/Yesod-Core.html#t:Header

@psibi

This comment has been minimized.

Show comment
Hide comment
@psibi

psibi Jul 13, 2017

Member

I think it would be better to just wrap it in CI type constructor instead of doing Eq instance fix.

Member

psibi commented Jul 13, 2017

I think it would be better to just wrap it in CI type constructor instead of doing Eq instance fix.

@paul-rouse

This comment has been minimized.

Show comment
Hide comment
@paul-rouse

paul-rouse Jul 13, 2017

Contributor

At the moment the code in #1417 would still need to be changed to use Eq on Header - does this actually go any wider than that code, or would it be best just to use CI for case-insensitivity there, for that one comparison?

Contributor

paul-rouse commented Jul 13, 2017

At the moment the code in #1417 would still need to be changed to use Eq on Header - does this actually go any wider than that code, or would it be best just to use CI for case-insensitivity there, for that one comparison?

@psibi

This comment has been minimized.

Show comment
Hide comment
@psibi

psibi Jul 13, 2017

Member

I would vote for using CI for case-insensitivity there as that's the most easiest thing to do. :)

Member

psibi commented Jul 13, 2017

I would vote for using CI for case-insensitivity there as that's the most easiest thing to do. :)

@snoyberg

This comment has been minimized.

Show comment
Hide comment
@snoyberg

snoyberg Jul 13, 2017

Member

@psibi Up until now, there has been no comparison performed there that I'm aware of. 20/20 hindsight, it would make sense to use CI ByteString, but I'd rather not break the API for this.

Member

snoyberg commented Jul 13, 2017

@psibi Up until now, there has been no comparison performed there that I'm aware of. 20/20 hindsight, it would make sense to use CI ByteString, but I'd rather not break the API for this.

@psibi psibi referenced this issue Jan 15, 2018

Merged

Better monads #1464

@snoyberg snoyberg closed this in 915d9e2 Feb 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment