Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion http-client-openssl/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

## 0.2.1.1

* Fix a connection-bug with http-proxy(Previous version closes a connection before reading all respose-data.)
* Fix a connection-bug with http-proxy(Previous version closes a connection before reading all response-data.)

## 0.2.1.0

Expand Down
2 changes: 1 addition & 1 deletion http-client-tls/test/Spec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ main = hspec $ do
-- the `supportedExtendedMainSecret` parameter `is `RequireEMS`, this means
-- that all the connections to a server not supporting TLS1.2+EMS will fail.
-- The badssl.com service does not yet support TLS1.2+EMS connections, so
-- let's switch to the value `AllowEMS`, ie: TLS1.2 conenctions without EMS.
-- let's switch to the value `AllowEMS`, ie: TLS1.2 connections without EMS.
#if MIN_VERSION_crypton_connection(0,4,0)
{settingClientSupported = def {TLS.supportedExtendedMainSecret = TLS.AllowEMS}}
#endif
Expand Down
8 changes: 4 additions & 4 deletions http-client/Network/HTTP/Client/Cookies.hs
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,15 @@ insertCheckedCookie :: Cookie -- ^ The 'SetCookie' the cookie jar is receivin
-> Bool -- ^ Whether or not this request is coming from an \"http\" source (not javascript or anything like that)
-> CookieJar -- ^ Updated (or not) cookie jar
insertCheckedCookie c cookie_jar is_http_api = case (do
(cookie_jar', cookie') <- existanceTest c cookie_jar
(cookie_jar', cookie') <- existenceTest c cookie_jar
return $ insertIntoCookieJar cookie' cookie_jar') of
Just cj -> cj
Nothing -> cookie_jar
where existanceTest cookie cookie_jar' = existanceTestHelper cookie $ removeExistingCookieFromCookieJar cookie cookie_jar'
existanceTestHelper new_cookie (Just old_cookie, cookie_jar')
where existenceTest cookie cookie_jar' = existenceTestHelper cookie $ removeExistingCookieFromCookieJar cookie cookie_jar'
existenceTestHelper new_cookie (Just old_cookie, cookie_jar')
| not is_http_api && cookie_http_only old_cookie = Nothing
| otherwise = return (cookie_jar', new_cookie {cookie_creation_time = cookie_creation_time old_cookie})
existanceTestHelper new_cookie (Nothing, cookie_jar') = return (cookie_jar', new_cookie)
existenceTestHelper new_cookie (Nothing, cookie_jar') = return (cookie_jar', new_cookie)

-- | Turn a SetCookie into a Cookie, if it is valid
generateCookie :: SetCookie -- ^ The 'SetCookie' we are encountering
Expand Down
2 changes: 1 addition & 1 deletion http-client/Network/HTTP/Client/Headers.hs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ parseStatusHeaders mhl mnh conn timeout' onEarlyHintHeaders cont
Just header ->
parseHeaders (count + 1) $ front . (header:)
Nothing ->
-- Unparseable header line; rather than throwing
-- Unparsable header line; rather than throwing
-- an exception, ignore it for robustness.
parseHeaders count front

Expand Down
2 changes: 1 addition & 1 deletion http-client/Network/HTTP/Client/MultipartFormData.hs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ renderParts :: Applicative m
renderParts boundary parts = (fin . mconcat) <$> traverse (renderPart boundary) parts
where fin = (<> cp "--" <> cp boundary <> cp "--\r\n")

-- | Generate a boundary simillar to those generated by WebKit-based browsers.
-- | Generate a boundary similar to those generated by WebKit-based browsers.
webkitBoundary :: IO BS.ByteString
webkitBoundary = getStdRandom webkitBoundaryPure

Expand Down
2 changes: 1 addition & 1 deletion http-client/Network/HTTP/Client/Response.hs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ hasNoBody _ 204 = True
hasNoBody _ 304 = True
hasNoBody _ i = 100 <= i && i < 200

-- | Retrieve the orignal 'Request' from a 'Response'
-- | Retrieve the original 'Request' from a 'Response'
--
-- Note that the 'requestBody' is not available and always set to empty.
--
Expand Down
4 changes: 2 additions & 2 deletions http-client/Network/HTTP/Proxy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ headJust (Nothing:xs) = headJust xs
headJust ((y@(Just _)):_) = y

systemProxyHelper :: Maybe T.Text -> ProxyProtocol -> EnvHelper -> IO (Request -> Request)
systemProxyHelper envOveride prot eh = do
systemProxyHelper envOverride prot eh = do
let envName' Nothing = envName prot
envName' (Just name) = name

modifier <- envHelper (envName' envOveride)
modifier <- envHelper (envName' envOverride)

-- Under Windows try first env. variables override then Windows proxy settings
#if defined(mingw32_HOST_OS)
Expand Down
2 changes: 1 addition & 1 deletion http-conduit/Network/HTTP/Conduit.hs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
-- By default, when connecting to websites using HTTPS, functions in this
-- package will throw an exception if the TLS certificate doesn't validate. To
-- continue the HTTPS transaction even if the TLS cerficate validation fails,
-- you should use 'mkManagerSetttings' as follows:
-- you should use 'mkManagerSettings' as follows:
--
-- > import Network.Connection (TLSSettings (..))
-- > import Network.HTTP.Conduit
Expand Down
12 changes: 6 additions & 6 deletions http-conduit/test/CookieTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ testCookieEqualitySuccess = assertEqual "The same cookies should be equal"
cookie cookie
where cookie = default_cookie

testCookieEqualityResiliance :: IO ()
testCookieEqualityResiliance = assertBool "Cookies should still be equal if extra options are changed" $
testCookieEqualityResilience :: IO ()
testCookieEqualityResilience = assertBool "Cookies should still be equal if extra options are changed" $
(default_cookie {cookie_persistent = True}) `equivCookie` (default_cookie {cookie_host_only = True})

testDomainChangesEquality :: IO ()
Expand All @@ -159,8 +159,8 @@ testRemoveCookie :: IO ()
testRemoveCookie = assertEqual "Removing a cookie works"
(Just default_cookie, createCookieJar []) (removeExistingCookieFromCookieJar default_cookie $ createCookieJar [default_cookie])

testRemoveNonexistantCookie :: IO ()
testRemoveNonexistantCookie = assertEqual "Removing a nonexistent cookie doesn't work"
testRemoveNonexistentCookie :: IO ()
testRemoveNonexistentCookie = assertEqual "Removing a nonexistent cookie doesn't work"
(Nothing, createCookieJar [default_cookie]) (removeExistingCookieFromCookieJar (default_cookie {cookie_name = fromString "key2"}) $ createCookieJar [default_cookie])

testRemoveCorrectCookie :: IO ()
Expand Down Expand Up @@ -503,13 +503,13 @@ pathMatchingTests = do
equalityTests :: Spec
equalityTests = do
it "The same cookie should be equal to itself" testCookieEqualitySuccess
it "Changing extra options shouldn't change equality" testCookieEqualityResiliance
it "Changing extra options shouldn't change equality" testCookieEqualityResilience
it "Changing a cookie's domain should change its equality" testDomainChangesEquality

removeTests :: Spec
removeTests = do
it "Removing a cookie works" testRemoveCookie
it "Removing a nonexistent cookie doesn't work" testRemoveNonexistantCookie
it "Removing a nonexistent cookie doesn't work" testRemoveNonexistentCookie
it "Removing the correct cookie" testRemoveCorrectCookie

evictionTests :: Spec
Expand Down