Put original string instead of foldedCase#12
Put original string instead of foldedCase#12lyokha wants to merge 1 commit intohaskellari:masterfrom
Conversation
The foldedCase is derivative of the original string, while the latter is unique. So, putting foldedCase instead of original string leads to loss of data, while getting from the original string must always restore CI object correctly as it has been built from the original string. Probably it should also fix weird cases like in issue haskellari#7. My own case was restoring serialized ResponseHeaders from Network.HTTP.Types. Say, putting Custom-Header and restoring it later makes it custom-header (when I take it with original), while when putting original string it restores correctly as Custom-Header (when I take it with original).
|
IIRC my reasoning for using Specifically, HTTP headers are case insensitive, thus |
|
Yes, I see the reason. To be precise, equation Nevertheless, in my case I wanted to forward HTTP headers from a backend to the client, so I wanted to keep them equal (yes, I know that they are case-agnostic, however bad client implementations sometimes matter). |
>>> CI.mk "FOO" == CI.mk "foo"
TrueYou confuse |
|
I worked this around by putting |
The foldedCase is derivative of the original string, while the latter
is unique. So, putting foldedCase instead of original string leads to
loss of data, while getting from the original string must always restore
CI object correctly as it has been built from the original string.
Probably it should also fix weird cases like in issue #7.
My own case was restoring serialized ResponseHeaders from
Network.HTTP.Types. Say, putting Custom-Header and restoring it later
makes it custom-header (when I take it with original), while when
putting original string it restores correctly as Custom-Header (when I
take it with original).