question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

localhost url validation

See original GitHub issue

I noticed that localhost is not valid according to URL validator.

examples url: http://localhost/ http://localhost/deeplink

this is the regex used for validation right now: /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/i

the following change would fix it: /https?:\/\/(((www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-z]{2,63})|(localhost))\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/i I’d appreciate your feedback about it.

in addition, I’d like to know when is expected next release?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
mikeericksoncommented, Dec 12, 2020

@syabro Hey there, my apologies. I thought this had already been fixed, but alas I missed it. I am working on a new build (version 3.23) which I will include this issue.

1reaction
syabrocommented, Dec 13, 2020

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

UrlValidator is not working for localhost - Stack Overflow
I'm facing an issue that i'm using UrlValidator in my code. UrlValidator urlValidator = UrlValidator.getInstance(); if(urlValidator.isValid(url)) ...
Read more >
URL (with localhost) - Regex Tester/Debugger
Check if a string only contains numbers · Only letters and numbers · Match elements of a url · Url Validation Regex |...
Read more >
Validate localhost url · Issue #224 · jquense/yup - GitHub
This would be incredibly useful, my application requires setting OAuth redirect URL's within a form that I'm validating. For development these ...
Read more >
Host URL Pattern - RegExr
Regular expression tester with syntax highlighting, PHP / PCRE & JS Support, contextual help, cheat sheet, reference, and searchable community patterns.
Read more >
UrlValidator (Apache Commons Validator 1.7 API)
Allow local URLs, such as http://localhost/ or http://machine/ . static long, NO_FRAGMENTS. Enabling this options disallows any URL fragments. Constructor ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found