Skip to content

fix(services/tos): Set user agent header#7598

Merged
Xuanwo merged 2 commits into
apache:mainfrom
ddupg:codex/tos-user-agent
May 23, 2026
Merged

fix(services/tos): Set user agent header#7598
Xuanwo merged 2 commits into
apache:mainfrom
ddupg:codex/tos-user-agent

Conversation

@ddupg
Copy link
Copy Markdown
Member

@ddupg ddupg commented May 22, 2026

Which issue does this PR close?

Part of #7152.

Rationale for this change

Set OpenDAL User-Agent for TOS requests.

What changes are included in this PR?

  • Add User-Agent: opendal/{VERSION} in TOS send/fetch paths.

Are there any user-facing changes?

No public API changes.

AI Usage Statement

This PR was implemented with OpenAI Codex.

Change-Id: I3ff844b612becbb94fe24667a7d2646a9054c212
@ddupg ddupg marked this pull request as ready for review May 22, 2026 14:10
@ddupg ddupg requested a review from Xuanwo as a code owner May 22, 2026 14:10
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. releases-note/fix The PR fixes a bug or has a title that begins with "fix" labels May 22, 2026
Comment thread core/services/tos/src/core.rs Outdated
pub code: String,
pub message: String,
pub request_id: String,
fn insert_tos_user_agent_header(headers: &mut http::HeaderMap) {
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.

We don't need this funciton.

Comment thread core/services/tos/src/core.rs Outdated
}

pub async fn fetch(&self, req: Request<Buffer>) -> Result<Response<HttpBody>> {
pub async fn fetch(&self, mut req: Request<Buffer>) -> Result<Response<HttpBody>> {
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.

We can just impl under this line so we don't need to insert it twice.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the review, updated. User-Agent is added after signing so it won’t be part of the signature.

Change-Id: Ia4a6a8000fe769142587cd57dff12078415cfc19
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels May 23, 2026
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label May 23, 2026
@Xuanwo Xuanwo merged commit 1020918 into apache:main May 23, 2026
379 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants