mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
fix(HTTP Request Node): Proxy IPv6 hostname fix (no-changelog) (#9149)
This commit is contained in:
parent
a95e401696
commit
80c8791b96
|
@ -518,8 +518,9 @@ export async function parseRequestObject(requestObject: IRequestOptions) {
|
||||||
if (typeof requestObject.proxy === 'string') {
|
if (typeof requestObject.proxy === 'string') {
|
||||||
try {
|
try {
|
||||||
const url = new URL(requestObject.proxy);
|
const url = new URL(requestObject.proxy);
|
||||||
|
const host = url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname;
|
||||||
axiosConfig.proxy = {
|
axiosConfig.proxy = {
|
||||||
host: url.hostname,
|
host,
|
||||||
port: parseInt(url.port, 10),
|
port: parseInt(url.port, 10),
|
||||||
protocol: url.protocol,
|
protocol: url.protocol,
|
||||||
};
|
};
|
||||||
|
@ -544,8 +545,9 @@ export async function parseRequestObject(requestObject: IRequestOptions) {
|
||||||
const [userpass, hostport] = requestObject.proxy.split('@');
|
const [userpass, hostport] = requestObject.proxy.split('@');
|
||||||
const [username, password] = userpass.split(':');
|
const [username, password] = userpass.split(':');
|
||||||
const [hostname, port] = hostport.split(':');
|
const [hostname, port] = hostport.split(':');
|
||||||
|
const host = hostname.startsWith('[') ? hostname.slice(1, -1) : hostname;
|
||||||
axiosConfig.proxy = {
|
axiosConfig.proxy = {
|
||||||
host: hostname,
|
host,
|
||||||
port: parseInt(port, 10),
|
port: parseInt(port, 10),
|
||||||
protocol: 'http',
|
protocol: 'http',
|
||||||
auth: {
|
auth: {
|
||||||
|
|
Loading…
Reference in a new issue