Skip to content

Target Validation: Subdomains with a hyphen aren't considered valid #77

Description

@handymenny

The regex used for target validation is defined here:
https://github.com/checktheroads/hyperglass/blob/c25cc5f3e13272b0534051e5a09614f852e2211c/hyperglass/ui/components/QueryTarget.js#L5

Example of domains that fails the validation:

  • r3.sn-fpoq-o52l.googlevideo.com
  • speedtest-mi1.cloudfire.it

I think the following regex should fix the bug:
/^(?!:\/\/)([a-zA-Z0-9][a-zA-Z0-9-]+\.)?[a-zA-Z0-9][a-zA-Z0-9-]+\.[a-zA-Z]{2,6}?$/gim

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions