Skip to content

fix(cli): replace is-url validation to support network hostnames like 'gateway'#1015

Merged
tw93 merged 2 commits into
tw93:mainfrom
vaddisrinivas:main
Aug 13, 2025
Merged

fix(cli): replace is-url validation to support network hostnames like 'gateway'#1015
tw93 merged 2 commits into
tw93:mainfrom
vaddisrinivas:main

Conversation

@vaddisrinivas

Copy link
Copy Markdown
Contributor

Fix URL validation to support network hostnames without TLD

Fixes #1014

Problem

CLI rejects valid network hostnames like gateway or router with error: "Your url is invalid"

Solution

  • Replace is-url package with native URL constructor
  • Remove is-url and @types/is-url dependencies
  • Use web standard URL validation instead of restrictive package

Changes

  • bin/utils/url.ts: Replace isUrl() with new URL() in try-catch
  • package.json: Remove is-url dependencies

Testing

pake http://gateway --name GatewayApp now works
✅ All existing URLs still work
✅ only rejects invalid urls.
✅ Supports network hostnames without TLD

@tw93 tw93 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you, Bro.
LGTM

@tw93 tw93 merged commit 26d4592 into tw93:main Aug 13, 2025
tw93 added a commit that referenced this pull request May 6, 2026
fix(cli): replace is-url validation to support network hostnames like 'gateway'
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.

[Bug] URL validation rejects valid network hostnames

2 participants