[Git][haskell-team/DHG_packages][master] http-client: patch to ignore malformed headers
Sean Whitton
gitlab at salsa.debian.org
Tue Jul 9 19:59:18 BST 2019
Sean Whitton pushed to branch master at Debian Haskell Group / DHG_packages
Commits:
5fcc4f42 by Sean Whitton at 2019-07-09T18:55:50Z
http-client: patch to ignore malformed headers
- - - - -
3 changed files:
- p/haskell-http-client/debian/changelog
- + p/haskell-http-client/debian/patches/ignore-malformed-headers.diff
- p/haskell-http-client/debian/patches/series
Changes:
=====================================
p/haskell-http-client/debian/changelog
=====================================
@@ -1,3 +1,10 @@
+haskell-http-client (0.5.13.1-3) unstable; urgency=medium
+
+ * Backport upstream commit 503d88f0f165453c295f530d74f27f8f689ace2d as
+ ignore-malformed-headers.diff (Closes: #931715).
+
+ -- Sean Whitton <spwhitton at spwhitton.name> Tue, 09 Jul 2019 19:55:33 +0100
+
haskell-http-client (0.5.13.1-2) unstable; urgency=medium
* Remove build dependency on libghc-text-dev (provided by ghc-8.4.3)
=====================================
p/haskell-http-client/debian/patches/ignore-malformed-headers.diff
=====================================
@@ -0,0 +1,31 @@
+Backported from upstream commit
+503d88f0f165453c295f530d74f27f8f689ace2d. See #931715.
+
+--- a/Network/HTTP/Client/Headers.hs
++++ b/Network/HTTP/Client/Headers.hs
+@@ -84,13 +84,20 @@ parseStatusHeaders conn timeout' cont
+ 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)
=====================================
p/haskell-http-client/debian/patches/series
=====================================
@@ -1 +1,2 @@
disable-external-network-connection-test.diff
+ignore-malformed-headers.diff
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/commit/5fcc4f42bb8cd7f01c8beaea7555ea7528bc8596
--
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/commit/5fcc4f42bb8cd7f01c8beaea7555ea7528bc8596
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20190709/1681414a/attachment-0001.html>
More information about the Pkg-haskell-commits
mailing list