Skip to content

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

Open
codefix-patchflow[bot] wants to merge 1 commit into
masterfrom
codefix/4318ee86-url-returns-false-for-urls-like-some-hostname-90
Open

fix: treat protocol-less host:port URLs as valid in isURL#2
codefix-patchflow[bot] wants to merge 1 commit into
masterfrom
codefix/4318ee86-url-returns-false-for-urls-like-some-hostname-90

Conversation

@codefix-patchflow

Copy link
Copy Markdown

What failed

URL returns false for urls like some-hostname:9000 after 13.15.20 version bump, 13.15.15 works as expected returning true Examples validator.isURL("my-3272-service:9000", { require_tld: false, require_valid_protocol: false }); // returns false in 13.15.20 Additional context Validator.js version: 13.15.20 Node.js version: 22.14.0 OS platform: linux

What changed

Patchflow applied a minimal source change for the reported failure.

  • src/lib/isURL.js around line 115 (modified, +32/-25)
  • test/validators.test.js around line 499 (modified, +1/-0)

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

A concise pull request is created with a clear review note

Patchflow did not run repository-local commands; the automated review gate checks the patch without assuming the project full runtime environment is available.

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

Automation details
  • Job ID: 4318ee86-9a0d-4ae9-8250-45896117a1d8
  • Repository: CDEN190/validator.js
  • Branch: codefix/4318ee86-url-returns-false-for-urls-like-some-hostname-90
  • Base branch: master
  • Reference command: None
  • Review gate: automated static review; repository-local commands were not executed.

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.

0 participants