Skip to content

Commit bcef15d

Browse files
committed
Put original string instead of foldedCase
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).
1 parent 9040f38 commit bcef15d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Data/Binary/Instances/CaseInsensitive.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ import qualified Data.CaseInsensitive as CI
88

99
instance (CI.FoldCase a, Binary a) => Binary (CI.CI a) where
1010
get = fmap CI.mk get
11-
put = put . CI.foldedCase
11+
put = put . CI.original

0 commit comments

Comments
 (0)