diff --git a/Web/Scotty/Util.hs b/Web/Scotty/Util.hs index 69766509..6e600c4d 100644 --- a/Web/Scotty/Util.hs +++ b/Web/Scotty/Util.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE LambdaCase #-} module Web.Scotty.Util ( lazyTextToStrictByteString @@ -34,8 +35,10 @@ lazyTextToStrictByteString = ES.encodeUtf8 . TL.toStrict strictByteStringToLazyText :: B.ByteString -> TL.Text strictByteStringToLazyText = TL.fromStrict . ES.decodeUtf8With ES.lenientDecode +#if !MIN_VERSION_text(2,0,0) decodeUtf8Lenient :: B.ByteString -> TP.Text decodeUtf8Lenient = ES.decodeUtf8With ES.lenientDecode +#endif -- Note: we currently don't support responseRaw, which may be useful -- for websockets. However, we always read the request body, which