Skip to content

feat(services/gcs): propagate response header overrides into presigned XML requests - #8206

Merged
Xuanwo merged 1 commit into
apache:mainfrom
SatyamPandey-07:feat/gcs-presign-response-overrides
Sep 1, 2026
Merged

feat(services/gcs): propagate response header overrides into presigned XML requests#8206
Xuanwo merged 1 commit into
apache:mainfrom
SatyamPandey-07:feat/gcs-presign-response-overrides

Conversation

@SatyamPandey-07

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #8187.

Rationale for this change

OpenDAL's GCS backend generates presigned URLs for read and stat requests via the GCS XML API (gcs_get_object_xml_request and gcs_head_object_xml_request). However, response header overrides (override_content_disposition, override_content_type, and override_cache_control) provided on OpRead / OpStat were previously dropped and not appended to the URL before signing.

The GCS XML API supports response-content-disposition, response-content-type, and response-cache-control query parameters on GET/HEAD requests. This PR propagates those overrides into the query string so the presigned URLs return the requested response headers.

What changes are included in this PR?

  • core/services/gcs/src/core.rs:
    • Added constants for response-content-disposition, response-content-type, and response-cache-control.
    • Updated gcs_get_object_xml_request and gcs_head_object_xml_request to percent-encode and append response override query parameters when set in OpRead / OpStat.
    • Added unit tests test_gcs_get_object_xml_request_with_response_overrides and test_gcs_head_object_xml_request_with_response_overrides.

Are there any user-facing changes?

Yes. Calling presign_read_with or presign_stat_with on GCS with override_content_disposition, override_content_type, or override_cache_control now includes the corresponding query parameters in the generated signed URL.

AI Usage Statement

AI assisted in drafting the query parameter propagation and unit tests for GCS XML requests. The changes, XML query parameters, and test cases were reviewed and verified.

@SatyamPandey-07
SatyamPandey-07 force-pushed the feat/gcs-presign-response-overrides branch from 893f51a to c824ce4 Compare August 31, 2026 14:22
@Xuanwo

Xuanwo commented Aug 31, 2026

Copy link
Copy Markdown
Member

The only thing is to get CI happy, otherwise LGTM. Thank you!

@SatyamPandey-07
SatyamPandey-07 force-pushed the feat/gcs-presign-response-overrides branch from c824ce4 to fc79da7 Compare August 31, 2026 15:52
@SatyamPandey-07

Copy link
Copy Markdown
Contributor Author

done @Xuanwo sir

@SatyamPandey-07
SatyamPandey-07 force-pushed the feat/gcs-presign-response-overrides branch from fc79da7 to e5995af Compare August 31, 2026 16:11
…d XML requests

Propagate override_content_disposition, override_content_type, and override_cache_control into query parameters (response-content-disposition, response-content-type, response-cache-control) for GCS XML GET and HEAD presigned requests.

Closes apache#8187.
@SatyamPandey-07
SatyamPandey-07 force-pushed the feat/gcs-presign-response-overrides branch from e5995af to 990bc42 Compare August 31, 2026 17:37

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Xuanwo
Xuanwo merged commit 670d8f9 into apache:main Sep 1, 2026
107 of 108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

new feature: propagate response header overrides into GCS presigned reads

2 participants