From a1be331ac87cbc0212ab532c47e1dd572bce58ba Mon Sep 17 00:00:00 2001 From: Benjamin Summers Date: Fri, 13 Dec 2019 02:10:53 -0800 Subject: [PATCH] Make HTTP Server more lenient. --- pkg/king/lib/Arvo/Common.hs | 2 +- pkg/king/lib/Vere/Http.hs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/king/lib/Arvo/Common.hs b/pkg/king/lib/Arvo/Common.hs index 6f7c23266..51b47c978 100644 --- a/pkg/king/lib/Arvo/Common.hs +++ b/pkg/king/lib/Arvo/Common.hs @@ -33,7 +33,7 @@ newtype ServId = ServId { unServId :: UV } -- Http Common ----------------------------------------------------------------- -data Header = Header Cord Cord +data Header = Header Cord Bytes deriving (Eq, Ord, Show) data ResponseHeader = ResponseHeader diff --git a/pkg/king/lib/Vere/Http.hs b/pkg/king/lib/Vere/Http.hs index 82a171c4c..3d2d8e33c 100644 --- a/pkg/king/lib/Vere/Http.hs +++ b/pkg/king/lib/Vere/Http.hs @@ -15,9 +15,9 @@ convertHeaders :: [HT.Header] -> [Header] convertHeaders = fmap f where f (k, v) = Header (Cord $ decodeUtf8 $ CI.foldedCase k) - (Cord $ decodeUtf8 v) + (MkBytes v) unconvertHeaders :: [Header] -> [HT.Header] unconvertHeaders = fmap f where - f (Header (Cord k) (Cord v)) = (CI.mk (encodeUtf8 k), (encodeUtf8 v)) + f (Header (Cord k) (MkBytes v)) = (CI.mk (encodeUtf8 k), v)