diff options
author | Marc Coquand <marcc@fastmail.fr> | 2023-12-03 12:52:07 -0600 |
---|---|---|
committer | Marc Coquand <marcc@fastmail.fr> | 2023-12-03 12:52:07 -0600 |
commit | 867761a2e764c6c6327434585498ed62c54f6eac (patch) | |
tree | 38ab8ffd581a2cb3acfcdf25fcd593f211a094f0 /lib/user.ml | |
parent | f192457e19486cdfbc8ac62684d33ac4b6c82bc1 (diff) | |
download | wormhole-867761a2e764c6c6327434585498ed62c54f6eac.tar.gz wormhole-867761a2e764c6c6327434585498ed62c54f6eac.tar.bz2 wormhole-867761a2e764c6c6327434585498ed62c54f6eac.zip |
Formatting, support whitelist
Diffstat (limited to 'lib/user.ml')
-rw-r--r-- | lib/user.ml | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/user.ml b/lib/user.ml index f0ac7cf..ba802c0 100644 --- a/lib/user.ml +++ b/lib/user.ml @@ -17,14 +17,12 @@ let activity_header = Some (Header.of_list [ ("Accept", "application/activity+json") ]) let get_user actor_url = - try%lwt - let%lwt _, body = - Client.get ?headers:activity_header (Uri.of_string actor_url) - in - body |> Cohttp_lwt.Body.to_string >|= fun body -> - let body = Yojson.Safe.from_string body |> t_of_yojson in - Ok body - with exn -> Lwt.return (Error exn) + let%lwt _, body = + Client.get ?headers:activity_header (Uri.of_string actor_url) + in + body |> Cohttp_lwt.Body.to_string >|= fun body -> + let body = Yojson.Safe.from_string body |> t_of_yojson in + body let get_public_pem user = user.public_key.public_key_pem |> Cstruct.of_string |