Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs in wrapper around gcloud rewrite #39

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/storage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ type rewrite_object_response = {
kind : string;
total_bytes_rewritten : string; [@key "totalBytesRewritten"]
object_size : string; [@key "objectSize"]
done_ : bool;
done_ : bool; [@key "done"]
rewrite_token : string option; [@key "rewriteToken"] [@default None]
resource : Yojson.Safe.t option; [@default None]
}
Expand All @@ -111,6 +111,8 @@ let rewrite_object source_bucket source_object destination_bucket
Lwt.catch
(fun () ->
let uri =
let source_object = Uri.pct_encode source_object in
let destination_object = Uri.pct_encode destination_object in
Uri.make () ~scheme:"https" ~host:"storage.googleapis.com"
~path:
(Printf.sprintf "storage/v1/b/%s/o/%s/rewriteTo/b/%s/o/%s"
Expand Down
Loading