Additionally allow "bearer" instead of only "Bearer" in Authorization… (#1558)
This commit is contained in:
+7
-4
@@ -190,15 +190,18 @@ noBlankHeader = notElem mempty
|
||||
noProfileHeader :: [Header] -> Bool
|
||||
noProfileHeader headers = isNothing $ find ((== "Content-Profile") . fst) headers
|
||||
|
||||
authHeader :: BS.ByteString -> BS.ByteString -> Header
|
||||
authHeader typ creds =
|
||||
(hAuthorization, typ <> " " <> creds)
|
||||
|
||||
authHeaderBasic :: BS.ByteString -> BS.ByteString -> Header
|
||||
authHeaderBasic u p =
|
||||
(hAuthorization, "Basic " <> (toS . B64.encode . toS $ u <> ":" <> p))
|
||||
authHeader "Basic" $ toS . B64.encode . toS $ u <> ":" <> p
|
||||
|
||||
authHeaderJWT :: BS.ByteString -> Header
|
||||
authHeaderJWT token =
|
||||
(hAuthorization, "Bearer " <> token)
|
||||
authHeaderJWT = authHeader "Bearer"
|
||||
|
||||
-- | Tests whether the text can be parsed as a json object comtaining
|
||||
-- | Tests whether the text can be parsed as a json object containing
|
||||
-- the key "message", and optional keys "details", "hint", "code",
|
||||
-- and no extraneous keys
|
||||
isErrorFormat :: BL.ByteString -> Bool
|
||||
|
||||
Reference in New Issue
Block a user