Always remove www. from hostname matching.
This commit is contained in:
parent
f261052331
commit
befcfdb85f
|
@ -26,7 +26,10 @@ export abstract class Redirect<P extends RedirectParameters> {
|
|||
|
||||
public isMatch(url: URL): boolean {
|
||||
if (this.parameters.matcherType === 'hostname') {
|
||||
return url.hostname === this.parameters.toMatch;
|
||||
const hostname = url.hostname.startsWith('www.')
|
||||
? url.hostname.slice(4)
|
||||
: url.hostname;
|
||||
return hostname === this.parameters.toMatch;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue