Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ var isURI = require( '@stdlib/assert/is-uri' );

// VARIABLES //

var RE_HTTPS = /^https?:\/\//;
// URI schemes are case-insensitive (see RFC 3986, Section 3.1):
var RE_HTTPS = /^https?:\/\//i;


// MAIN //
Expand Down
16 changes: 16 additions & 0 deletions lib/node_modules/@stdlib/assert/is-absolute-http-uri/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ tape( 'the function returns `true` if provided a valid absolute HTTP(S) URI', fu
t.end();
});

tape( 'the function returns `true` if provided a valid absolute HTTP(S) URI having an uppercase or mixed-case scheme', function test( t ) {
var values;
var i;

values = [
'HTTP://example.com',
'HTTPS://example.com',
'Http://example.com/',
'hTTpS://example.com:8080/foo/bar?baz=qux'
];
for ( i = 0; i < values.length; i++ ) {
t.strictEqual( isAbsoluteHttpURI( values[ i ] ), true, values[ i ] );
}
t.end();
});

tape( 'the function returns `false` if provided an absolute non-HTTP(S) URI', function test( t ) {
var values;
var i;
Expand Down
Loading