http-conduit 1.8.4.1 → 1.8.4.2
raw patch · 5 files changed
+16/−7 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Network/HTTP/Conduit.hs +2/−2
- Network/HTTP/Conduit/Cookies.hs +8/−3
- Network/HTTP/Conduit/Request.hs +3/−0
- http-conduit.cabal +1/−1
- test/main.hs +2/−1
Network/HTTP/Conduit.hs view
@@ -202,9 +202,9 @@ Just exc -> do exc' <- case fromException exc of- Just (StatusCodeException s hs) -> do+ Just (StatusCodeException s hdrs) -> do lbs <- body C.$$+- CB.take 1024- return $ toException $ StatusCodeException s $ hs +++ return $ toException $ StatusCodeException s $ hdrs ++ [("X-Response-Body-Start", S.concat $ L.toChunks lbs)] _ -> do let CI.ResumableSource _ final = body
Network/HTTP/Conduit/Cookies.hs view
@@ -2,6 +2,7 @@ module Network.HTTP.Conduit.Cookies where import qualified Data.ByteString as BS+import qualified Data.ByteString.Char8 as S8 import qualified Data.ByteString.UTF8 as U import Text.Regex import Data.Maybe@@ -53,11 +54,15 @@ -- in section 5.1.4 pathMatches :: BS.ByteString -> BS.ByteString -> Bool pathMatches requestPath cookiePath- | cookiePath == requestPath = True- | cookiePath `BS.isPrefixOf` requestPath && BS.singleton (BS.last cookiePath) == U.fromString "/" = True- | cookiePath `BS.isPrefixOf` requestPath && BS.singleton (BS.head remainder) == U.fromString "/" = True+ | cookiePath == path = True+ | cookiePath `BS.isPrefixOf` path && BS.singleton (BS.last cookiePath) == U.fromString "/" = True+ | cookiePath `BS.isPrefixOf` path && BS.singleton (BS.head remainder) == U.fromString "/" = True | otherwise = False where remainder = BS.drop (BS.length cookiePath) requestPath+ path = case S8.uncons requestPath of+ Just ('/', _) -> requestPath+ _ -> '/' `S8.cons` requestPath+ -- This corresponds to the description of a cookie detailed in Section 5.3 \"Storage Model\" data Cookie = Cookie
Network/HTTP/Conduit/Request.hs view
@@ -1,6 +1,9 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE CPP #-}++{-# OPTIONS_GHC -fno-warn-orphans #-}+ module Network.HTTP.Conduit.Request ( Request (..) , RequestBody (..)
http-conduit.cabal view
@@ -1,5 +1,5 @@ name: http-conduit-version: 1.8.4.1+version: 1.8.4.2 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>
test/main.hs view
@@ -13,6 +13,7 @@ import Network.HTTP.Types import Control.Exception.Lifted (try, SomeException) import Network.HTTP.Conduit.ConnInfo+import Network (withSocketsDo) import CookieTest (cookieTest) import Data.Conduit.Network (runTCPServer, serverSettings, HostPreference (HostAny), appSink, appSource) import Data.Conduit (($$), yield)@@ -37,7 +38,7 @@ where tastyCookie = (mk (fromString "Set-Cookie"), fromString "flavor=chocolate-chip;") main :: IO ()-main = hspec $ do+main = withSocketsDo $ hspec $ do cookieTest describe "simpleHttp" $ do it "gets homepage" $ do