From 8295a6e5d57a801f667057cc5f3ff0435184e5fe Mon Sep 17 00:00:00 2001 From: Mingfei Shao <2475897+mfshao@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:34:24 -0600 Subject: [PATCH 1/2] Update indexd.py --- fence/blueprints/data/indexd.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fence/blueprints/data/indexd.py b/fence/blueprints/data/indexd.py index 186f08bcc..c21dd37c4 100755 --- a/fence/blueprints/data/indexd.py +++ b/fence/blueprints/data/indexd.py @@ -174,7 +174,9 @@ def _log_signed_url_data_info(indexed_file, user_sub, requested_protocol): authz = indexed_file.index_document.get("authz") # the behavior later on is to pick the 1st location as the signed URL if a protocol is not requested - protocol = requested_protocol or indexed_file.indexed_file_locations[0].protocol + protocol = requested_protocol + if not protocol and indexed_file.indexed_file_locations: + protocol = indexed_file.indexed_file_locations[0].protocol # figure out which bucket was used based on the protocol bucket = "" From 8cbaa5f822ba6a0e25a7fd7dbb4decc96496da9e Mon Sep 17 00:00:00 2001 From: Mingfei Shao <2475897+mfshao@users.noreply.github.com> Date: Fri, 8 Dec 2023 14:38:49 -0600 Subject: [PATCH 2/2] Update indexd.py --- fence/blueprints/data/indexd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fence/blueprints/data/indexd.py b/fence/blueprints/data/indexd.py index c21dd37c4..93cf60525 100755 --- a/fence/blueprints/data/indexd.py +++ b/fence/blueprints/data/indexd.py @@ -173,7 +173,7 @@ def _log_signed_url_data_info(indexed_file, user_sub, requested_protocol): acl = indexed_file.index_document.get("acl") authz = indexed_file.index_document.get("authz") - # the behavior later on is to pick the 1st location as the signed URL if a protocol is not requested + # the behavior later on is to pick the 1st location as the signed URL if a protocol is not requested, if available protocol = requested_protocol if not protocol and indexed_file.indexed_file_locations: protocol = indexed_file.indexed_file_locations[0].protocol