Skip to content

Send User-Agent header on app storage uploads - #640

Merged
diemol merged 1 commit into
mainfrom
fix/user-agent-multipart-upload
Oct 20, 2026
Merged

diemol merged 1 commit into
mainfrom
fix/user-agent-multipart-upload

Conversation

@diemol

@diemol diemol commented Oct 20, 2026

Copy link
Copy Markdown
Member

Description

StorageEndpoint.postMultipartResponse builds its own request and did not set the User-Agent header. All other requests get it from AbstractEndpoint.createRequest. This PR adds the header to the upload request too.

Motivation and Context

Every HTTP request should send User-Agent: SauceREST/<version>. File uploads to app storage were the only ones missing it.

How Has This Been Tested?

Added UserAgentTest. It uses an OkHttp interceptor to capture the outgoing request and checks the User-Agent header for a regular request (getFiles) and for an upload (uploadFile). The upload test fails without the fix and passes with it.

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (change which improves current code base; please describe the change)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Screenshots (if appropriate):

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • All new and existing tests passed locally
  • I have added necessary documentation (if appropriate)

Further comments

Locally, 14 existing unit tests fail only because Sauce credentials are not set (MissingCredentials). They are not related to this change.

🤖 Generated with Claude Code

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity · 0 duplication

Metric Results
Complexity 4
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

The multipart upload request in StorageEndpoint was built without the
User-Agent header that all other requests send. Add it, plus a unit
test that checks the header on a regular request and on an upload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@diemol
diemol force-pushed the fix/user-agent-multipart-upload branch from c68e895 to 29516a8 Compare October 20, 2026 10:26
@diemol
diemol merged commit de34d1c into main Oct 20, 2026
12 checks passed
@diemol
diemol deleted the fix/user-agent-multipart-upload branch October 20, 2026 10:38
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.

1 participant