mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 11:22:15 +00:00
🐛 Fix "Ignore response code" flag in http request node (#2284)
This commit is contained in:
@@ -303,7 +303,7 @@ async function parseRequestObject(requestObject: IDataObject) {
|
|||||||
axiosConfig.maxRedirects = 0;
|
axiosConfig.maxRedirects = 0;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
requestObject.followAllRedirect === false &&
|
requestObject.followAllRedirects === false &&
|
||||||
((requestObject.method as string | undefined) || 'get').toLowerCase() !== 'get'
|
((requestObject.method as string | undefined) || 'get').toLowerCase() !== 'get'
|
||||||
) {
|
) {
|
||||||
axiosConfig.maxRedirects = 0;
|
axiosConfig.maxRedirects = 0;
|
||||||
@@ -420,6 +420,16 @@ async function proxyRequestToAxios(
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
|
if (configObject.simple === true && error.response) {
|
||||||
|
resolve({
|
||||||
|
body: error.response.data,
|
||||||
|
headers: error.response.headers,
|
||||||
|
statusCode: error.response.status,
|
||||||
|
statusMessage: error.response.statusText,
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.debug('Request proxied to Axios failed', { error });
|
Logger.debug('Request proxied to Axios failed', { error });
|
||||||
// Axios hydrates the original error with more data. We extract them.
|
// Axios hydrates the original error with more data. We extract them.
|
||||||
// https://github.com/axios/axios/blob/master/lib/core/enhanceError.js
|
// https://github.com/axios/axios/blob/master/lib/core/enhanceError.js
|
||||||
|
|||||||
Reference in New Issue
Block a user