fix build with text older than 2.0
This commit is contained in:
parent
e73bbdd95c
commit
acb436b999
1 changed files with 4 additions and 0 deletions
|
@ -151,7 +151,11 @@ data Auth = Auth B.ByteString B.ByteString
|
||||||
|
|
||||||
instance ToHttpApiData Auth where
|
instance ToHttpApiData Auth where
|
||||||
toHeader (Auth u p) = "Basic " <> B64.encode (u <> ":" <> p)
|
toHeader (Auth u p) = "Basic " <> B64.encode (u <> ":" <> p)
|
||||||
|
#if MIN_VERSION_text(2,0,0)
|
||||||
toUrlPiece = TE.decodeUtf8Lenient . toHeader
|
toUrlPiece = TE.decodeUtf8Lenient . toHeader
|
||||||
|
#else
|
||||||
|
toUrlPiece = TE.decodeUtf8With (\_ _ -> Just '\xfffd') . toHeader
|
||||||
|
#endif
|
||||||
|
|
||||||
instance FromHttpApiData Auth where
|
instance FromHttpApiData Auth where
|
||||||
parseHeader h =
|
parseHeader h =
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue