Skip to content

[fix] ipv6 hostnames are not correctly matched #34

@AilPhaune

Description

@AilPhaune

Describe the bug

Node.js version:
v23.9.0

OS version:
WSL2 Ubuntu: Linux 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Description:
ipv6 hostnames are not correctly matched in urls

Actual behavior

Matches only the ::1 part in http://[::1]/

Expected behavior

It should match the whole http://[::1]/

Code to reproduce

const urlRegexSafe = require('url-regex-safe');
// Expected: http://[::1]/
// Actual: ::1
console.log('http://[::1]/'.match(urlRegexSafe()));

Checklist

  • I have searched through GitHub issues for similar issues.
  • I have completely read through the README and documentation.
  • I have tested my code with the latest version of Node.js and this package and confirmed it is still not working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions