diff --git a/src/Vervis/Handler/Inbox.hs b/src/Vervis/Handler/Inbox.hs index 068ef1d..5908756 100644 --- a/src/Vervis/Handler/Inbox.hs +++ b/src/Vervis/Handler/Inbox.hs @@ -273,7 +273,7 @@ postOutboxR = do case eres of Left (APGetErrorHTTP e) -> setMessage $ toHtml $ "Failed to GET the recipient actor: " <> T.pack (displayException e) Left (APGetErrorJSON e) -> setMessage $ toHtml $ "Failed to parse recipient actor JSON: " <> T.pack (displayException e) - Left (APGetErrorContentType e) -> setMessage $ toHtml $ "Got unexpected Content-Type for actor JSON: " <> T.pack e + Left (APGetErrorContentType e) -> setMessage $ toHtml $ "Got unexpected Content-Type for actor JSON: " <> e Right response -> do let actor = getResponseBody response if actorId actor /= to diff --git a/src/Web/ActivityPub.hs b/src/Web/ActivityPub.hs index f775b56..930b764 100644 --- a/src/Web/ActivityPub.hs +++ b/src/Web/ActivityPub.hs @@ -254,7 +254,7 @@ provideAP v = do data APGetError = APGetErrorHTTP HttpException | APGetErrorJSON JSONException - | APGetErrorContentType String + | APGetErrorContentType Text deriving Show instance Exception APGetError @@ -285,7 +285,7 @@ httpGetAP manager uri = then case responseBody r of Left e -> Left $ APGetErrorJSON e Right v -> Right $ v <$ r - else Left $ APGetErrorContentType "Non-AP Content-Type" + else Left $ APGetErrorContentType $ "Non-AP Content-Type: " <> decodeUtf8 b _ -> Left $ APGetErrorContentType "Multiple Content-Type" -- Set method to POST, Set Content-Type, make HTTP signature, set response to throw on non-2xx