feat: update dependencies, node
This commit is contained in:
+14
@@ -71,3 +71,17 @@ export const isDomainOrSubdomain = (destination, original) => {
|
||||
|
||||
return orig === dest || orig.endsWith(`.${dest}`);
|
||||
};
|
||||
|
||||
/**
|
||||
* isSameProtocol reports whether the two provided URLs use the same protocol.
|
||||
*
|
||||
* Both domains must already be in canonical form.
|
||||
* @param {string|URL} original
|
||||
* @param {string|URL} destination
|
||||
*/
|
||||
export const isSameProtocol = (destination, original) => {
|
||||
const orig = new URL(original).protocol;
|
||||
const dest = new URL(destination).protocol;
|
||||
|
||||
return orig === dest;
|
||||
};
|
||||
|
||||
+1
-1
@@ -119,7 +119,7 @@ export function isOriginPotentiallyTrustworthy(url) {
|
||||
// 5. If origin's host component is "localhost" or falls within ".localhost", and the user agent conforms to the name resolution rules in [let-localhost-be-localhost], return "Potentially Trustworthy".
|
||||
// We are returning FALSE here because we cannot ensure conformance to
|
||||
// let-localhost-be-loalhost (https://tools.ietf.org/html/draft-west-let-localhost-be-localhost)
|
||||
if (/^(.+\.)*localhost$/.test(url.host)) {
|
||||
if (url.host === 'localhost' || url.host.endsWith('.localhost')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user