Skip to content

fix(url): reject http(s) URLs without a host - #53

Open
MrBeldum wants to merge 1 commit into
foomo:mainfrom
MrBeldum:fix/url-require-host
Open

MrBeldum wants to merge 1 commit into
foomo:mainfrom
MrBeldum:fix/url-require-host

Conversation

@MrBeldum

@MrBeldum MrBeldum commented Oct 5, 2026

Copy link
Copy Markdown

Summary

rule.URL accepted values like http://, https:, and http:/// because url.ParseRequestURI succeeds with an empty host as long as a scheme is present. Those are not usable HTTP(S) destinations.

Require a non-empty host when the scheme is http or https. Other schemes are unchanged.

Test plan

  • Added TestURLRequiresHostForHTTP
  • go test ./rule/...

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