Skip to content

Commit dc4b8ba

Browse files
committed
switch to standalone base64 lib
1 parent 2d40681 commit dc4b8ba

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

lib/api_remote.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ module Github : Api.Github = struct
3434
try
3535
response.content |> String.split_lines |> String.concat |> decode_string_pad |> Config_j.config_of_string
3636
|> fun res -> Lwt.return @@ Ok res
37-
with Base64.Invalid_char as exn ->
37+
with exn ->
3838
let e = Exn.to_string exn in
3939
Lwt.return
40-
@@ fmt_error "error while decoding base64 in GitHub response: %s\nfailed to get config from file %s" e url
40+
@@ fmt_error "error while reading config from GitHub response: %s\nfailed to get config from file %s" e url
4141
end
4242
| encoding ->
4343
Lwt.return

lib/common.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let first_line s =
2323
| [] -> s
2424

2525
let decode_string_pad s =
26-
String.rstrip ~drop:(List.mem [ '='; ' '; '\n'; '\r'; '\t' ] ~equal:Char.equal) s |> Base64.decode_string
26+
String.rstrip ~drop:(List.mem [ '='; ' '; '\n'; '\r'; '\t' ] ~equal:Char.equal) s |> Base64.decode_exn ~pad:false
2727

2828
let http_request ?headers ?body meth path =
2929
match%lwt Web.http_request_lwt ~ua:"monorobot" ~verbose:true ?headers ?body meth path with

lib/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(library
22
(name lib)
3-
(libraries atdgen atdgen-runtime base base.caml biniou cstruct curl curl.lwt
3+
(libraries atdgen atdgen-runtime base base64 base.caml biniou cstruct curl curl.lwt
44
devkit devkit.core extlib hex lwt lwt.unix nocrypto omd re stdio uri
55
yojson)
66
(preprocess

monorobot.opam

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ depends: [
1313
"dune" {>= "2.5.0"}
1414
"atdgen"
1515
"base"
16+
"base64"
1617
"biniou"
1718
"cmdliner"
1819
"cstruct"

0 commit comments

Comments
 (0)