Skip to content

Hyphen before a dot is a valid url #2249

Open
@lskiva-r7

Description

@lskiva-r7

Describe the bug
The following url is valid:
my-.url.com

But it returns false

> validator.isURL('my-.url.com')
false
> validator.isURL('my.url.com')
true

It does accept - it just has an issue if it's right before the period:

> validator.isURL('m-y.url.com')
true

Additional context
Validator.js version: 13.7
Node.js version: v16.14.0
OS platform: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions