ogt / valid-url Goto Github PK
View Code? Open in Web Editor NEWNode module that provides URI validation functions
Home Page: https://npmjs.org/package/valid-url
License: Other
Node module that provides URI validation functions
Home Page: https://npmjs.org/package/valid-url
License: Other
Run with isWebUri
and isUri
Hi! I've been using this great library for a while and doesn't have problem at all. Until I try to use it to validate a github ssh url, like "git@github:xxx/repo.git". Is this SSH uri also a valid url that we should support in this library?
*Reference for the ssh url https://tools.ietf.org/id/draft-salowey-secsh-uri-00.html.
The tests aren't the original ones included in the perl code.
The current version includes only a few positive tests - return true in every function is considered an acceptable result..
This means that we can't have confidence that the implementation/functionality of the module is consistent with the original.
Should have noticed when the original pull request came ....
isHttpUri and isHttpsUri methods both report 'http://http://blah' as valid.
Currently is_iri
fails on any characters, which don't match this regex:
Line 28 in 8d1fc52
Example:
t.ok(is_uri('http://localhost/ä'), 'http://localhost/ä');
As far as I understand the main difference between URI and IRI is:
IRIs extend URIs by using the Universal Character Set, where URIs were limited to ASCII, with far fewer characters.
https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier
Therefore is_iri
should allow all UTF-8 characters and these exports aren't correct:
module.exports.is_uri = is_iri;
module.exports.isUri = is_iri;
Instead there should be two exports: is_iri
and is_uri
.
I saw there wasn't any commit to this repo since 2015, but since this affects a Gatsby issue I was wondering, what you plans with the module are? Do you think about handing it over, @ogt?
The module is used heavily according to npms download numbers, so it might be in the interest of the community to give it some 💌 .
https://gist.github.com/mxpv/034933deeebb26b62f14
Was running the above through valid-url and here are the ones that failed when they should have succeeded:
http://✪df.ws/123
http://➡.ws/䨹
http://⌘.ws
http://⌘.ws/
http://foo.com/unicode_(✪)_in_parens
http://☺.damowmow.com/
http://مثال.إختبار
http://例子.测试
http://उदाहरण.परीक्षा
isUri
returns undefined for urls starting with a double slash, as in //lh6.ggpht.com/5mI27oolnooL__S3ns9qAf_6TsFNExMtUAwTKz6prWCxEmVkmZZZwe3lI-ZLbMawEJh3=w300
which I understand is a valid url. For instance, Google play uses it for its images and icons.
Congrats on the 1.3 million weekly downloads, but no updates in 7 years, and no replies to issues?
I have an issue to validating the URL
For an example
var url = "http://localhost:4001//app**//**test#//dash//Dashboard1"
if (validUrl.isUri(url)){
console.log('Looks like an URI');
} else {
console.log('Not a URI');
}
The output says valid url but I want to validate the double slash also.
Some of my customers makes mistakes to give the url input so its redirects to some other pages.
Your input url is :https:::///wwww.google.com
Looks like an valid URI
var validator = require('valid-url');
console.log( validator.isWebUri('http://foo') );
prints http://foo
(e.g. true), which is not correct. There is no TLD. Valid URLs will have at least one dot and 1 character after the dot.
NPM is not picking up on this project being MIT licensed. The licence detection is used by a couple of compliance analyzers, so it would be helpful to change the entry from none
to MIT
.
I am not sure what the issue is.
Is that intentional behaviour or a bug?
NPM is not picking up on this project being MIT licensed. The licence detection is used by a couple of compliance analyzers, so it would be helpful to change the entry from none
to MIT
.
I am not sure what the issue is.
isWebUri('http://das-küchengeflüster.de/feed') returns undefined.
Replicates the functionality of http://search.cpan.org/~sonnen/Data-Validate-URI-0.01/lib/Data/Validate/URI.pm
(http://anonscm.debian.org/gitweb/?p=users/dom/libdata-validate-uri-perl.git )
into a nodejs module.
The module (named valid-url)
sourced@oDesk for $75 : https://www.odesk.com/jobs/~~40efa52e915abd59
https://https://www.facebook.com/sunnybens
this thing above cannot be a valid url but its accepted
I used the valid-url for my project.
I detected one issue when use this module for the URL that contain ";".
In URL Object it detects that this is not URL but valie-url module passed this.
Could you fix this?
This is my code.
var validUrl = require('valid-url');
if (validUrl.isUri('https://shop.delacier.com;hu.shop.delacier.com/products.json')){
console.log('Looks like an URI');
var myURL = new URL('https://shop.delacier.com;hu.shop.delacier.com/products.json');
console.log(myURL);
} else {
console.log('Not a URI');
var myURL = new URL('https://shop.delacier.com;hu.shop.delacier.com/products.json');
console.log(myURL);
}
Error is following
×
TypeError: Failed to construct 'URL': Invalid URL
Module../src/Pages/AddFeed/FeedUpload.js
E:/ModaComprise/NewCollabration/src/Pages/AddFeed/FeedUpload.js:33
30 |
31 | if (validUrl.isUri('https://shop.delacier.com;hu.shop.delacier.com/products.json')){
32 | console.log('Looks like an URI');
33 | var myURL = new URL('https://shop.delacier.com;hu.shop.delacier.com/products.json');
34 | console.log(myURL);
35 | } else {
36 |
View compiled
IsHttpsUri check is failing on valid urls like - http://polish.pl/sport-mezczyzni/asics/?sport_type=piłkaó
Symbols like ó caused this error.
Maybe some filters can be added, like WhiteList some characters?
try to verify that url: http://wrong%20link.tech/JFKblue.gif
if (validUrl.isWebUri(http://wrong%20link.tech/JFKblue.gif)){ console.log('Looks like an URI');
in logs I see that it looks like an URI, but it's not.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.