Skip to content

Add User-Agent to all request#23030

Merged
stonezdj merged 1 commit intogoharbor:mainfrom
stonezdj:26mar24_add_user_agent
Mar 27, 2026
Merged

Add User-Agent to all request#23030
stonezdj merged 1 commit intogoharbor:mainfrom
stonezdj:26mar24_add_user_agent

Conversation

@stonezdj
Copy link
Contributor

set user agent to avoid some registry (e.g. docker hub) return 403 when user agent is not set to harbor-registry-client
fixes #23025

Thank you for contributing to Harbor!

Comprehensive Summary of your change

Issue being fixed

Fixes #(issue)

Please indicate you've done the following:

  • Well Written Title and Summary of the PR
  • Label the PR as needed. "release-note/ignore-for-release, release-note/new-feature, release-note/update, release-note/enhancement, release-note/community, release-note/breaking-change, release-note/docs, release-note/infra, release-note/deprecation"
  • Accepted the DCO. Commits without the DCO will delay acceptance.
  • Made sure tests are passing and test coverage is added if needed.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed in website repository.

@stonezdj stonezdj requested a review from a team as a code owner March 25, 2026 03:00
@codecov
Copy link

codecov bot commented Mar 25, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.02%. Comparing base (1c7d831) to head (71692d7).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/pkg/registry/auth/authorizer.go 42.85% 3 Missing and 1 partial ⚠️
src/pkg/reg/adapter/aliacr/openapi.go 0.00% 2 Missing ⚠️
src/server/registry/manifest.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #23030   +/-   ##
=======================================
  Coverage   66.02%   66.02%           
=======================================
  Files        1073     1073           
  Lines      116495   116503    +8     
  Branches     2939     2939           
=======================================
+ Hits        76912    76919    +7     
  Misses      35329    35329           
- Partials     4254     4255    +1     
Flag Coverage Δ
unittests 66.02% <50.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/common/utils/utils.go 82.23% <100.00%> (+0.18%) ⬆️
src/pkg/registry/auth/bearer/authorizer.go 64.63% <100.00%> (+0.43%) ⬆️
src/pkg/registry/client.go 45.04% <100.00%> (ø)
src/server/registry/manifest.go 68.15% <0.00%> (ø)
src/pkg/reg/adapter/aliacr/openapi.go 0.00% <0.00%> (ø)
src/pkg/registry/auth/authorizer.go 45.12% <42.85%> (-0.34%) ⬇️

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stonezdj stonezdj assigned wy65701436 and MinerYang and unassigned Vad1mo and OrlinVasilev Mar 25, 2026
 set user agent to avoid some registry (e.g. docker hub) return 403 when user agent is not set to harbor-registry-client
 fixes goharbor#23025

Signed-off-by: stonezdj <stonezdj@gmail.com>
@stonezdj stonezdj force-pushed the 26mar24_add_user_agent branch from a9faa2f to 71692d7 Compare March 25, 2026 03:15
@stonezdj stonezdj added the release-note/update Update or Fix label Mar 25, 2026
Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

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

lgtm

@stonezdj stonezdj merged commit 200217c into goharbor:main Mar 27, 2026
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-note/update Update or Fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proxy Cache project not working on v2.15.0

6 participants