Bug#931715: please update to 0.6.4

Joey Hess id at joeyh.name
Tue Jul 9 16:38:58 BST 2019


Sean Whitton wrote:
> Looks like it's not in Stackage LTS yet.  I see you wrote the patch.
> Would it be enough to backport it to what's currently in sid?

Patch backport attached.

-- 
see shy jo
-------------- next part --------------
diff -ur haskell-http-client-0.5.13.1.orig/Network/HTTP/Client/Headers.hs haskell-http-client-0.5.13.1/Network/HTTP/Client/Headers.hs
--- haskell-http-client-0.5.13.1.orig/Network/HTTP/Client/Headers.hs	2018-04-09 09:40:11.000000000 -0400
+++ haskell-http-client-0.5.13.1/Network/HTTP/Client/Headers.hs	2019-07-09 11:37:17.499256981 -0400
@@ -84,13 +84,20 @@
         if S.null line
             then return $ front []
             else do
-                header <- parseHeader line
-                parseHeaders (count + 1) $ front . (header:)
+                mheader <- parseHeader line
+                case mheader of
+                    Just header ->
+                        parseHeaders (count + 1) $ front . (header:)
+                    Nothing ->
+                        -- Unparseable header line; rather than throwing
+                        -- an exception, ignore it for robustness.
+                        parseHeaders count front
 
-    parseHeader :: S.ByteString -> IO Header
+    parseHeader :: S.ByteString -> IO (Maybe Header)
     parseHeader bs = do
         let (key, bs2) = S.break (== charColon) bs
-        when (S.null bs2) $ throwHttp $ InvalidHeader bs
-        return (CI.mk $! strip key, strip $! S.drop 1 bs2)
+        if S.null bs2
+            then return Nothing
+            else return (Just (CI.mk $! strip key, strip $! S.drop 1 bs2))
 
     strip = S.dropWhile (== charSpace) . fst . S.spanEnd (== charSpace)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-maintainers/attachments/20190709/2e7f9c37/attachment.sig>


More information about the Pkg-haskell-maintainers mailing list