mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(core): Use hostname from URL instead of Host header for SNI (#8562)
This commit is contained in:
@@ -2,6 +2,7 @@ import {
|
||||
copyInputItems,
|
||||
getBinaryDataBuffer,
|
||||
parseIncomingMessage,
|
||||
parseRequestObject,
|
||||
proxyRequestToAxios,
|
||||
setBinaryDataBuffer,
|
||||
} from '@/NodeExecuteFunctions';
|
||||
@@ -21,6 +22,7 @@ import nock from 'nock';
|
||||
import { tmpdir } from 'os';
|
||||
import { join } from 'path';
|
||||
import Container from 'typedi';
|
||||
import type { Agent } from 'https';
|
||||
|
||||
const temporaryDir = mkdtempSync(join(tmpdir(), 'n8n'));
|
||||
|
||||
@@ -358,6 +360,16 @@ describe('NodeExecuteFunctions', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('parseRequestObject', () => {
|
||||
test('should not use Host header for SNI', async () => {
|
||||
const axiosOptions = await parseRequestObject({
|
||||
url: 'https://example.de/foo/bar',
|
||||
headers: { Host: 'other.host.com' },
|
||||
});
|
||||
expect((axiosOptions.httpsAgent as Agent).options.servername).toEqual('example.de');
|
||||
});
|
||||
});
|
||||
|
||||
describe('copyInputItems', () => {
|
||||
it('should pick only selected properties', () => {
|
||||
const output = copyInputItems(
|
||||
|
||||
Reference in New Issue
Block a user