Remove errReasonPhrase from servant-client test.
This commit is contained in:
parent
eb7111b965
commit
0eb19f73d5
1 changed files with 2 additions and 7 deletions
|
@ -177,9 +177,7 @@ basicAuthHandler =
|
|||
authHandler :: AuthHandler Request ()
|
||||
authHandler =
|
||||
let handler req = case lookup "AuthHeader" (requestHeaders req) of
|
||||
Nothing -> throwE (err401 { errBody = "Missing auth header"
|
||||
, errReasonPhrase = "denied!"
|
||||
})
|
||||
Nothing -> throwE (err401 { errBody = "Missing auth header" })
|
||||
Just _ -> return ()
|
||||
in mkAuthHandler handler
|
||||
|
||||
|
@ -191,9 +189,6 @@ serverConfig = basicAuthHandler :. authHandler :. EmptyConfig
|
|||
authServer :: Application
|
||||
authServer = serve authAPI serverConfig (const (return alice) :<|> const (return alice))
|
||||
|
||||
{-
|
||||
-}
|
||||
|
||||
{-# NOINLINE manager #-}
|
||||
manager :: C.Manager
|
||||
manager = unsafePerformIO $ C.newManager C.defaultManagerSettings
|
||||
|
@ -359,7 +354,7 @@ authSpec = beforeAll (startWaiApp authServer) $ afterAll endWaiApp $ do
|
|||
let (_ :<|> getProtected) = client authAPI baseUrl manager
|
||||
let authRequest = mkAuthenticateReq () (\_ req -> SCR.addHeader "Wrong" ("header" :: String) req)
|
||||
Left FailureResponse{..} <- runExceptT (getProtected authRequest)
|
||||
responseStatus `shouldBe` (Status 401 "denied")
|
||||
responseStatus `shouldBe` (Status 401 "Unauthorized")
|
||||
|
||||
-- * utils
|
||||
|
||||
|
|
Loading…
Reference in a new issue