mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Forward authorization header when on same domain (#8507)
This commit is contained in:
@@ -452,6 +452,15 @@ async function parseRequestObject(requestObject: IDataObject) {
|
||||
axiosConfig.maxRedirects = 0;
|
||||
}
|
||||
|
||||
axiosConfig.beforeRedirect = (redirectedRequest) => {
|
||||
if (axiosConfig.headers?.Authorization) {
|
||||
redirectedRequest.headers.Authorization = axiosConfig.headers.Authorization;
|
||||
}
|
||||
if (axiosConfig.auth) {
|
||||
redirectedRequest.auth = `${axiosConfig.auth.username}:${axiosConfig.auth.password}`;
|
||||
}
|
||||
};
|
||||
|
||||
if (requestObject.rejectUnauthorized === false) {
|
||||
axiosConfig.httpsAgent = new Agent({
|
||||
rejectUnauthorized: false,
|
||||
|
||||
Reference in New Issue
Block a user