]> dgit.raspbian.org Git - git-annex.git/commitdiff
fix build with text older than 2.0
authorJoey Hess <joeyh@joeyh.name>
Mon, 29 Jul 2024 22:15:29 +0000 (18:15 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 29 Jul 2024 22:15:29 +0000 (18:15 -0400)
P2P/Http/Types.hs

index b7f7ce4807b43885b6f52f6f9116a3e98094aff4..92d6bab207a8be06680f0ef962824b2a591e0c40 100644 (file)
@@ -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 =