Preserve query variables when redirecting
This commit is contained in:
parent
5539519691
commit
90e8714e71
|
@ -189,7 +189,8 @@ export abstract class Server {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected withBase(request: http.IncomingMessage, path: string): string {
|
protected withBase(request: http.IncomingMessage, path: string): string {
|
||||||
return `${this.protocol}://${request.headers.host}${this.options.basePath}${path}`;
|
const split = request.url ? request.url.split("?", 2) : [];
|
||||||
|
return `${this.protocol}://${request.headers.host}${this.options.basePath}${path}${split.length === 2 ? `?${split[1]}` : ""}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
private onRequest = async (request: http.IncomingMessage, response: http.ServerResponse): Promise<void> => {
|
private onRequest = async (request: http.IncomingMessage, response: http.ServerResponse): Promise<void> => {
|
||||||
|
|
Loading…
Reference in New Issue