Skip to content

fix: treat protocol-less host:port URLs as valid in isURL#1

Open
codefix-patchflow[bot] wants to merge 1 commit into
masterfrom
codefix/f131b4ce-describe-the-bug
Open

fix: treat protocol-less host:port URLs as valid in isURL#1
codefix-patchflow[bot] wants to merge 1 commit into
masterfrom
codefix/f131b4ce-describe-the-bug

Conversation

@codefix-patchflow

@codefix-patchflow codefix-patchflow Bot commented Jun 11, 2026

Copy link
Copy Markdown

What failed

isURL treated protocol-less service URLs such as my-3272-service:9000 as if my-3272-service were a protocol, so validation returned false after the 13.15.20 update even with require_tld: false and require_valid_protocol: false.

What changed

  • src/lib/isURL.js now detects a numeric host:port suffix before consuming text before : as a protocol.
  • test/validators.test.js adds the reported my-3272-service:9000 regression case.

Why this works

The parser distinguishes a numeric host:port suffix from a protocol delimiter, so protocol-less service hostnames continue through normal host and port validation while require_protocol still rejects URLs without an explicit protocol.

Expected result

validator.isURL("my-3272-service:9000", { require_tld: false, require_valid_protocol: false }) returns true, and the existing URL validation matrix remains green.

Patchflow did not run repository-local commands during generation; GitHub Actions ran the repository CI on the delivered pull request.

🔧 Fixed automatically by Patchflow — $1/fix · no fix, no fee

Automation details
  • Job ID: f131b4ce-95d2-44aa-afbe-b1f8d608ca50
  • Repository: CDEN190/validator.js
  • Branch: codefix/f131b4ce-describe-the-bug
  • Base branch: master

@CDEN190 CDEN190 force-pushed the codefix/f131b4ce-describe-the-bug branch from 9b4a9e2 to a3932e0 Compare June 11, 2026 18:17
@CDEN190 CDEN190 changed the title fix: update src/lib/isCurrency.js fix: treat protocol-less host:port URLs as valid in isURL Jun 11, 2026
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