Force '/' in Zammad rewrites to prevent redirection
This commit is contained in:
parent
5020699033
commit
d80c4d6dc8
1 changed files with 5 additions and 1 deletions
|
|
@ -7,7 +7,11 @@ const rewriteURL = (
|
|||
destinationBaseURL: string,
|
||||
headers: any = {},
|
||||
) => {
|
||||
const destinationURL = request.url.replace(originBaseURL, destinationBaseURL);
|
||||
let path = request.url.replace(originBaseURL, "");
|
||||
if (path.startsWith("/")) {
|
||||
path = path.slice(1);
|
||||
}
|
||||
const destinationURL = `${destinationBaseURL}/${path}`;
|
||||
console.log(`Rewriting ${request.url} to ${destinationURL}`);
|
||||
const requestHeaders = new Headers(request.headers);
|
||||
requestHeaders.delete("x-forwarded-user");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue