From acb436b9993ec45f63ef221b8d5071b47abb81bc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 29 Jul 2024 18:15:29 -0400 Subject: [PATCH] fix build with text older than 2.0 --- P2P/Http/Types.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/P2P/Http/Types.hs b/P2P/Http/Types.hs index b7f7ce4807..92d6bab207 100644 --- a/P2P/Http/Types.hs +++ b/P2P/Http/Types.hs @@ -151,7 +151,11 @@ data Auth = Auth B.ByteString B.ByteString instance ToHttpApiData Auth where toHeader (Auth u p) = "Basic " <> B64.encode (u <> ":" <> p) +#if MIN_VERSION_text(2,0,0) toUrlPiece = TE.decodeUtf8Lenient . toHeader +#else + toUrlPiece = TE.decodeUtf8With (\_ _ -> Just '\xfffd') . toHeader +#endif instance FromHttpApiData Auth where parseHeader h =