2022-10-05 17:08:17 +00:00
|
|
|
import {Redirect} from './base.js';
|
|
|
|
|
2022-10-20 14:22:57 +00:00
|
|
|
export class HostnameRedirect extends Redirect {
|
2022-10-05 17:08:17 +00:00
|
|
|
public redirect(url: URL | string): URL {
|
|
|
|
const redirected = new URL(url);
|
2022-10-20 14:22:57 +00:00
|
|
|
redirected.hostname = this.parameters.redirectValue;
|
2022-10-05 17:08:17 +00:00
|
|
|
return redirected;
|
|
|
|
}
|
|
|
|
}
|