From e06b3dbd76a0a76c872ca27b4ea33b4465d14da3 Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Fri, 27 Dec 2013 05:36:45 +0400 Subject: Fix get_peers response encoding --- src/Data/Torrent/InfoHash.hs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Data/Torrent') diff --git a/src/Data/Torrent/InfoHash.hs b/src/Data/Torrent/InfoHash.hs index 4d49fcb7..9eec631c 100644 --- a/src/Data/Torrent/InfoHash.hs +++ b/src/Data/Torrent/InfoHash.hs @@ -120,6 +120,7 @@ instance Convertible BS.ByteString InfoHash where -- | Parse infohash from base16\/base32\/base64 encoded string. instance Convertible Text InfoHash where safeConvert t + | 20 == hashLen = pure (InfoHash hashStr) | 26 <= hashLen && hashLen <= 28 = case Base64.decode hashStr of Left msg -> convError ("invalid base64 encoding " ++ msg) t -- cgit v1.2.3