summaryrefslogtreecommitdiff
path: root/src/Network/URI/Charset.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Network/URI/Charset.hs')
-rw-r--r--src/Network/URI/Charset.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Network/URI/Charset.hs b/src/Network/URI/Charset.hs
index 5751eef..1f914ee 100644
--- a/src/Network/URI/Charset.hs
+++ b/src/Network/URI/Charset.hs
@@ -16,7 +16,9 @@ resolveCharset (mime:('c':'h':'a':'r':'s':'e':'t':'=':charset):_) response =
(mime, Left $ convertCharset charset $ B.toStrict response)
resolveCharset (mime:_:params) response = resolveCharset (mime:params) response
resolveCharset [mime] response = (mime, Right $ response)
-resolveCharset [] response = ("text/plain", Left "Filetype unspecified")
+-- NOTE I can't localize this error string because resolveCharset doesn't know the locale.
+-- I don't think this is worth fixing, because hitting this indicates the server is badly misbehaving.
+resolveCharset [] response = ("text/x-error\t", Left "Filetype unspecified")
-- | As per `resolveCharset`, but also returns given URI (or other type).
resolveCharset' :: a -> [String] -> ByteString -> (a, String, Either Text ByteString)