Skip to content

fix: validate URL schemes and single-label hosts#949

Open
puneetdixit200 wants to merge 1 commit into
goharbor:mainfrom
puneetdixit200:fix/validate-url-scheme-host
Open

fix: validate URL schemes and single-label hosts#949
puneetdixit200 wants to merge 1 commit into
goharbor:mainfrom
puneetdixit200:fix/validate-url-scheme-host

Conversation

@puneetdixit200
Copy link
Copy Markdown

Summary

  • reject non-HTTP(S) URLs in the shared URL validator with URL scheme must be http or https
  • allow RFC 1123-style single-label hosts such as http://harbor and https://registry:8443
  • add regression coverage for unsupported schemes and single-label host edge cases

Fixes #937.
Fixes #879.

Verification

  • go test ./pkg/utils
  • go test ./...
  • go build -o ./bin/harbor-cli cmd/harbor/main.go
  • ./bin/harbor-cli --help
  • git diff --check

AI disclosure

This contribution was prepared with AI assistance and reviewed before submission. I verified the changed validator logic and tests locally.

Signed-off-by: Puneet Dixit <236133619+puneetdixit200@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant