Simplify check in isDomainOrSubdomain (#1455)
This commit is contained in:
parent
36e47e8a64
commit
92dee097c6
|
@ -69,7 +69,5 @@ export const isDomainOrSubdomain = (destination, original) => {
|
|||
const orig = new URL(original).hostname;
|
||||
const dest = new URL(destination).hostname;
|
||||
|
||||
return orig === dest || (
|
||||
orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest)
|
||||
);
|
||||
return orig === dest || orig.endsWith(`.${dest}`);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue