Registry Mirror
Skip to content

isURL always checks host even if no host specified but query and path are #1994

Closed

Description

@mortbauer

Describe the bug
Although trying to be generic for different protocols the isURL check always valdiates hosts even if no host specified.

Examples
My use case is to validate a postgresql uri with using a unix socket which could look like:

postgres://user:pw@/test?host=/var/run/postgresql

isURL always returns false, not matter which options specified, even with require_host=false.

if i change the url to:

postgres://user:pw@localhost.com/test?host=/var/run/postgresql

it would validate to true.

Additional context
Validator.js version: 13.7.0 (current HEAD)
Node.js version: doesn't matter
OS platform: doesn't matter

Activity

  1. changed the title [-]isURL always checks for FQDN[/-] [+]isURL always checks host even if no host specified[/+] on Jul 2, 2022
  2. changed the title [-]isURL always checks host even if no host specified[/-] [+]isURL always checks host even if no host specified but query and path are[/+] on Jul 2, 2022
  3. pano9000 commented on Jan 23, 2023

    @pano9000
    Contributor

    closing, as this was fixed with commit 9f89f3b // PR #1995

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions