:: (Log :> es)
=> Request
-> Eff es Result
handleQuery req = do
let resource =
join (lookup "resource" (queryString req))
>>= BS.stripPrefix "acct:"
>>= WebFinger.parseHandle . T.decodeUtf8
case resource of
Just res -> WebFinger.lookupLocal res <&> maybe
(Error 404 "No such resource")
Value
Nothing -> return (Error 400 "Bad resource")
handleQuery