packages feed

req 3.12.0 → 3.13.0

raw patch · 4 files changed

+24/−7 lines, 4 filesdep +containersdep ~basedep ~http-clientdep ~http-types

Dependencies added: containers

Dependency ranges changed: base, http-client, http-types, mtl, template-haskell, transformers

Files

CHANGELOG.md view
@@ -1,3 +1,8 @@+## Req 3.13.0++* Add `headerRedacted` function to add header fields, which will be with+  redacted values on print.+ ## Req 3.12.0  * Add `isStatusCodeException` function.
Network/HTTP/Req.hs view
@@ -161,6 +161,7 @@     -- *** Headers     header,     attachHeader,+    headerRedacted,      -- *** Cookies     -- $cookies@@ -217,11 +218,12 @@ import Control.Applicative import Control.Arrow (first, second) import Control.Exception hiding (Handler (..), TypeError)+import Control.Monad (guard, void, (>=>)) import Control.Monad.Base import Control.Monad.Catch (Handler (..), MonadCatch, MonadMask, MonadThrow) import Control.Monad.IO.Class import Control.Monad.IO.Unlift-import Control.Monad.Reader+import Control.Monad.Reader (ReaderT (ReaderT), ask, lift, runReaderT) import Control.Monad.Trans.Accum (AccumT) import Control.Monad.Trans.Cont (ContT) import Control.Monad.Trans.Control@@ -254,6 +256,7 @@ import Data.Maybe (fromMaybe) import Data.Proxy import Data.Semigroup (Endo (..))+import qualified Data.Set as S import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.Encoding as T@@ -1559,6 +1562,14 @@ attachHeader :: ByteString -> ByteString -> L.Request -> L.Request attachHeader name value x =   x {L.requestHeaders = (CI.mk name, value) : L.requestHeaders x}++-- | Same as 'header', but with redacted values on print.+--+-- @since 3.13.0+headerRedacted :: ByteString -> ByteString -> Option scheme+headerRedacted name value = withRequest $ \x ->+  let y = attachHeader name value x+   in y {L.redactHeaders = CI.mk name `S.insert` L.redactHeaders y}  ---------------------------------------------------------------------------- -- Request—Optional parameters—Cookies
httpbin-tests/Network/HTTP/ReqSpec.hs view
@@ -8,7 +8,7 @@ module Network.HTTP.ReqSpec (spec) where  import Control.Exception-import Control.Monad.Reader+import Control.Monad (forM_) import Control.Monad.Trans.Control import Data.Aeson (ToJSON (..), Value (..), object, (.=)) import qualified Data.Aeson as A
req.cabal view
@@ -1,6 +1,6 @@ cabal-version:   2.4 name:            req-version:         3.12.0+version:         3.13.0 license:         BSD-3-Clause license-file:    LICENSE.md maintainer:      Mark Karpov <markkarpov92@gmail.com>@@ -40,9 +40,10 @@         bytestring >=0.10.8 && <0.12,         case-insensitive >=0.2 && <1.3,         connection >=0.2.2 && <0.4,+        containers >=0.5 && <0.7,         exceptions >=0.6 && <0.11,-        http-api-data >=0.2 && <0.5,-        http-client >=0.7 && <0.8,+        http-api-data >=0.2 && <0.6,+        http-client >=0.7.13.1 && <0.8,         http-client-tls >=0.3.2 && <0.4,         http-types >=0.8 && <10.0,         modern-uri >=0.3 && <0.4,@@ -52,7 +53,7 @@         template-haskell >=2.14 && <2.19,         text >=0.2 && <2.1,         time >=1.2 && <1.13,-        transformers >=0.5.3.0 && <0.6,+        transformers >=0.5.3.0 && <0.7,         transformers-base,         unliftio-core >=0.1.1 && <0.3 @@ -83,7 +84,7 @@         case-insensitive >=0.2 && <1.3,         hspec >=2.0 && <3.0,         hspec-core >=2.0 && <3.0,-        http-api-data >=0.2 && <0.5,+        http-api-data >=0.2 && <0.6,         http-client >=0.7 && <0.8,         http-types >=0.8 && <10.0,         modern-uri >=0.3 && <0.4,