diff --git a/chord_drs/routes.py b/chord_drs/routes.py index d16f7bf..6c1bdce 100644 --- a/chord_drs/routes.py +++ b/chord_drs/routes.py @@ -185,7 +185,7 @@ def build_blob_json(drs_blob: DrsBlob, inside_container: bool = False) -> DRSObj url_for("drs_service.object_download", object_id=drs_blob.id).lstrip("/") ) - default_access_method: DRSAccessMethodDict = { + https_access_method: DRSAccessMethodDict = { "access_url": { # url_for external was giving weird results - build the URL by hand instead using the internal url_for "url": blob_url, @@ -193,10 +193,10 @@ def build_blob_json(drs_blob: DrsBlob, inside_container: bool = False) -> DRSObj # out-of-band method, or the object's contents are public. This # will depend on how the service is deployed. }, - "type": "http", + "type": "https", } - access_methods: list[DRSAccessMethodDict] = [default_access_method] + access_methods: list[DRSAccessMethodDict] = [https_access_method] if inside_container and data_source == DATA_SOURCE_LOCAL: access_methods.append({ diff --git a/tests/test_routes.py b/tests/test_routes.py index 71780a6..dd485ba 100644 --- a/tests/test_routes.py +++ b/tests/test_routes.py @@ -26,8 +26,8 @@ def validate_object_fields(data, existing_id=None, with_internal_path=False): assert "size" in data assert "self_uri" in data - method_types = [method['type'] for method in data["access_methods"]] - assert "http" in method_types + method_types = [method["type"] for method in data["access_methods"]] + assert "https" in method_types if is_minio: assert "s3" in method_types elif is_local and with_internal_path: