@lowdefy/connection-axios-http 7.2.0 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connections/AxiosHttp/AxiosHttp/AxiosHttp.js +18 -15
- package/dist/connections/AxiosHttp/AxiosHttp/checkAllowedHost.js +29 -0
- package/dist/connections/AxiosHttp/AxiosHttp/createAxiosConfig.js +89 -0
- package/dist/connections/AxiosHttp/AxiosHttp/createPublicAgent.js +41 -0
- package/dist/connections/AxiosHttp/AxiosHttp/createRefusedError.js +24 -0
- package/dist/connections/AxiosHttp/connectionOnlyProperties.js +28 -0
- package/dist/connections/AxiosHttp/createRefusedPropertiesSchema.js +25 -0
- package/dist/connections/AxiosHttp/requestSchema.js +30 -0
- package/dist/connections/AxiosHttp/schema.js +48 -3
- package/dist/connections/AxiosHttp/unsupportedProperties.js +26 -0
- package/package.json +5 -4
|
@@ -12,23 +12,17 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/ import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import {
|
|
19
|
-
import schema from '../
|
|
15
|
+
*/ import axios from 'axios';
|
|
16
|
+
import { type } from '@lowdefy/helpers';
|
|
17
|
+
import createAxiosConfig from './createAxiosConfig.js';
|
|
18
|
+
import { REFUSED_CODE } from './createRefusedError.js';
|
|
19
|
+
import schema from '../requestSchema.js';
|
|
20
20
|
async function AxiosHttp({ request, connection }) {
|
|
21
|
+
const config = createAxiosConfig({
|
|
22
|
+
connection,
|
|
23
|
+
request
|
|
24
|
+
});
|
|
21
25
|
try {
|
|
22
|
-
const config = mergeObjects([
|
|
23
|
-
connection,
|
|
24
|
-
request
|
|
25
|
-
]);
|
|
26
|
-
if (config.httpAgentOptions) {
|
|
27
|
-
config.httpAgent = new http.Agent(config.httpAgentOptions);
|
|
28
|
-
}
|
|
29
|
-
if (config.httpsAgentOptions) {
|
|
30
|
-
config.httpsAgent = new https.Agent(config.httpsAgentOptions);
|
|
31
|
-
}
|
|
32
26
|
const res = await axios(config);
|
|
33
27
|
const { status, statusText, headers, method, path, data } = res;
|
|
34
28
|
return {
|
|
@@ -40,6 +34,15 @@ async function AxiosHttp({ request, connection }) {
|
|
|
40
34
|
data
|
|
41
35
|
};
|
|
42
36
|
} catch (error) {
|
|
37
|
+
// A refused address or host is raised inside axios, which wraps it (and follow-redirects wraps
|
|
38
|
+
// it again on a redirect), so the refusal is thrown as it was written.
|
|
39
|
+
let cause = error;
|
|
40
|
+
while(!type.isNone(cause)){
|
|
41
|
+
if (cause.code === REFUSED_CODE) {
|
|
42
|
+
throw cause;
|
|
43
|
+
}
|
|
44
|
+
cause = cause.cause;
|
|
45
|
+
}
|
|
43
46
|
if (error.response) {
|
|
44
47
|
const responseError = new Error(`Http response "${error.response.status}: ${error.response.statusText}".`, {
|
|
45
48
|
cause: error
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
import createRefusedError from './createRefusedError.js';
|
|
17
|
+
// Hosts match exactly, ignoring case and the brackets of an IPv6 literal.
|
|
18
|
+
function checkAllowedHost({ allowedHosts, url }) {
|
|
19
|
+
if (type.isNone(allowedHosts)) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const normalizeHost = (host)=>host.replace(/^\[|\]$/g, '').toLowerCase();
|
|
23
|
+
const hostname = normalizeHost(new URL(url).hostname);
|
|
24
|
+
if (allowedHosts.some((host)=>normalizeHost(host) === hostname)) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
throw createRefusedError(`AxiosHttp request to "${hostname}" was refused because the host is not in the connection's "allowedHosts".`);
|
|
28
|
+
}
|
|
29
|
+
export default checkAllowedHost;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import http from 'node:http';
|
|
16
|
+
import https from 'node:https';
|
|
17
|
+
import axios from 'axios';
|
|
18
|
+
import { mergeObjects, type } from '@lowdefy/helpers';
|
|
19
|
+
import checkAllowedHost from './checkAllowedHost.js';
|
|
20
|
+
import connectionOnlyProperties from '../connectionOnlyProperties.js';
|
|
21
|
+
import createPublicAgent from './createPublicAgent.js';
|
|
22
|
+
import unsupportedProperties from '../unsupportedProperties.js';
|
|
23
|
+
function createAxiosConfig({ connection, request }) {
|
|
24
|
+
const config = mergeObjects([
|
|
25
|
+
connection,
|
|
26
|
+
request
|
|
27
|
+
]);
|
|
28
|
+
// Request properties can be filled from the client payload, so the properties that decide where
|
|
29
|
+
// the server may connect always hold the connection's value. The request schema refuses them
|
|
30
|
+
// too; this keeps that true for any caller that skips the schema.
|
|
31
|
+
connectionOnlyProperties.forEach((key)=>{
|
|
32
|
+
if (type.isUndefined(connection[key])) {
|
|
33
|
+
delete config[key];
|
|
34
|
+
} else {
|
|
35
|
+
config[key] = connection[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
unsupportedProperties.forEach((key)=>{
|
|
39
|
+
delete config[key];
|
|
40
|
+
});
|
|
41
|
+
const { allowedHosts, allowInternalAddresses, httpAgentOptions, httpsAgentOptions } = config;
|
|
42
|
+
delete config.allowedHosts;
|
|
43
|
+
delete config.allowInternalAddresses;
|
|
44
|
+
delete config.httpAgentOptions;
|
|
45
|
+
delete config.httpsAgentOptions;
|
|
46
|
+
// The http adapter sends every socket through the agents below. The fetch adapter would not.
|
|
47
|
+
config.adapter = 'http';
|
|
48
|
+
config.beforeRedirect = (options)=>checkAllowedHost({
|
|
49
|
+
allowedHosts,
|
|
50
|
+
url: options.href
|
|
51
|
+
});
|
|
52
|
+
checkAllowedHost({
|
|
53
|
+
allowedHosts,
|
|
54
|
+
url: axios.getUri(config)
|
|
55
|
+
});
|
|
56
|
+
if (allowInternalAddresses === true) {
|
|
57
|
+
if (!type.isNone(httpAgentOptions)) {
|
|
58
|
+
config.httpAgent = new http.Agent(httpAgentOptions);
|
|
59
|
+
}
|
|
60
|
+
if (!type.isNone(httpsAgentOptions)) {
|
|
61
|
+
config.httpsAgent = new https.Agent(httpsAgentOptions);
|
|
62
|
+
}
|
|
63
|
+
return config;
|
|
64
|
+
}
|
|
65
|
+
// Each of these connects somewhere the agents' address check cannot see: a local socket, a
|
|
66
|
+
// proxy that resolves and connects on the server's behalf, or the HTTP/2 transport, which
|
|
67
|
+
// does not use the agents.
|
|
68
|
+
if (!type.isNone(config.socketPath)) {
|
|
69
|
+
throw new Error('AxiosHttp property "socketPath" needs "allowInternalAddresses: true" on the connection.');
|
|
70
|
+
}
|
|
71
|
+
if (!type.isNone(config.proxy)) {
|
|
72
|
+
throw new Error('AxiosHttp property "proxy" needs "allowInternalAddresses: true" on the connection, since the server cannot check the address a proxy connects to.');
|
|
73
|
+
}
|
|
74
|
+
if (config.httpVersion === 2) {
|
|
75
|
+
throw new Error('AxiosHttp property "httpVersion: 2" needs "allowInternalAddresses: true" on the connection, since HTTP/2 connections skip the address check.');
|
|
76
|
+
}
|
|
77
|
+
// false, not undefined: undefined makes axios read HTTP_PROXY and HTTPS_PROXY from the environment.
|
|
78
|
+
config.proxy = false;
|
|
79
|
+
config.httpAgent = createPublicAgent({
|
|
80
|
+
Agent: http.Agent,
|
|
81
|
+
agentOptions: httpAgentOptions
|
|
82
|
+
});
|
|
83
|
+
config.httpsAgent = createPublicAgent({
|
|
84
|
+
Agent: https.Agent,
|
|
85
|
+
agentOptions: httpsAgentOptions
|
|
86
|
+
});
|
|
87
|
+
return config;
|
|
88
|
+
}
|
|
89
|
+
export default createAxiosConfig;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { isIP } from 'node:net';
|
|
16
|
+
import createLookupPublicAddress from '@lowdefy/node-utils/createLookupPublicAddress.js';
|
|
17
|
+
import isPublicAddress from '@lowdefy/node-utils/isPublicAddress.js';
|
|
18
|
+
import createRefusedError from './createRefusedError.js';
|
|
19
|
+
// An http or https agent that opens sockets only to public addresses. Every socket axios opens,
|
|
20
|
+
// for the first request and every redirect, comes from the agent. A hostname is checked by the
|
|
21
|
+
// agent's lookup, so the address checked is the address connected to. Node skips the lookup for
|
|
22
|
+
// an IP literal, so a literal is checked before connecting.
|
|
23
|
+
function createPublicAgent({ Agent, agentOptions }) {
|
|
24
|
+
const createNotPublicError = (hostname)=>createRefusedError(`AxiosHttp request to "${hostname}" was refused because it leads to an address that is not public. Set "allowInternalAddresses: true" on the connection to call a service on the same machine or network.`);
|
|
25
|
+
const agent = new Agent({
|
|
26
|
+
...agentOptions,
|
|
27
|
+
lookup: createLookupPublicAddress({
|
|
28
|
+
createNotPublicError
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
const createConnection = agent.createConnection;
|
|
32
|
+
agent.createConnection = function createPublicConnection(options, callback) {
|
|
33
|
+
if (isIP(options.host) !== 0 && !isPublicAddress(options.host)) {
|
|
34
|
+
callback(createNotPublicError(options.host));
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
return createConnection.call(this, options, callback);
|
|
38
|
+
};
|
|
39
|
+
return agent;
|
|
40
|
+
}
|
|
41
|
+
export default createPublicAgent;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ const REFUSED_CODE = 'ERR_AXIOS_HTTP_REFUSED';
|
|
16
|
+
// A refusal is raised inside axios (an agent's lookup or connect, or a redirect hook), which wraps
|
|
17
|
+
// it. The code lets AxiosHttp find it in the cause chain and throw it as it was written.
|
|
18
|
+
function createRefusedError(message) {
|
|
19
|
+
const error = new Error(message);
|
|
20
|
+
error.code = REFUSED_CODE;
|
|
21
|
+
return error;
|
|
22
|
+
}
|
|
23
|
+
export { REFUSED_CODE };
|
|
24
|
+
export default createRefusedError;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // Properties that decide where the server may connect. Request properties can be filled from the
|
|
16
|
+
// client payload, so these are read from the connection only: the request schema refuses them,
|
|
17
|
+
// and createAxiosConfig takes their value from the connection whatever the request holds.
|
|
18
|
+
const connectionOnlyProperties = [
|
|
19
|
+
'allowAbsoluteUrls',
|
|
20
|
+
'allowedHosts',
|
|
21
|
+
'allowInternalAddresses',
|
|
22
|
+
'httpAgentOptions',
|
|
23
|
+
'httpsAgentOptions',
|
|
24
|
+
'httpVersion',
|
|
25
|
+
'proxy',
|
|
26
|
+
'socketPath'
|
|
27
|
+
];
|
|
28
|
+
export default connectionOnlyProperties;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // A properties schema entry for each key that fails whenever the key is present.
|
|
16
|
+
function createRefusedPropertiesSchema({ keys, reason }) {
|
|
17
|
+
return Object.fromEntries(keys.map((key)=>[
|
|
18
|
+
key,
|
|
19
|
+
{
|
|
20
|
+
not: {},
|
|
21
|
+
errorMessage: `AxiosHttp property "${key}" ${reason}`
|
|
22
|
+
}
|
|
23
|
+
]));
|
|
24
|
+
}
|
|
25
|
+
export default createRefusedPropertiesSchema;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import connectionOnlyProperties from './connectionOnlyProperties.js';
|
|
16
|
+
import connectionSchema from './schema.js';
|
|
17
|
+
import createRefusedPropertiesSchema from './createRefusedPropertiesSchema.js';
|
|
18
|
+
// The connection schema, with the properties that decide where the server may connect refused:
|
|
19
|
+
// request properties can be filled from the client payload.
|
|
20
|
+
export default {
|
|
21
|
+
...connectionSchema,
|
|
22
|
+
title: 'Lowdefy Request Schema - AxiosHttp',
|
|
23
|
+
properties: {
|
|
24
|
+
...connectionSchema.properties,
|
|
25
|
+
...createRefusedPropertiesSchema({
|
|
26
|
+
keys: connectionOnlyProperties,
|
|
27
|
+
reason: 'can only be set on the connection.'
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
};
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
13
|
See the License for the specific language governing permissions and
|
|
14
14
|
limitations under the License.
|
|
15
|
-
*/
|
|
15
|
+
*/ import createRefusedPropertiesSchema from './createRefusedPropertiesSchema.js';
|
|
16
|
+
import unsupportedProperties from './unsupportedProperties.js';
|
|
17
|
+
export default {
|
|
16
18
|
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
17
19
|
title: 'Lowdefy Connection Schema - AxiosHttp',
|
|
18
20
|
type: 'object',
|
|
@@ -135,10 +137,53 @@
|
|
|
135
137
|
},
|
|
136
138
|
proxy: {
|
|
137
139
|
type: 'object',
|
|
138
|
-
description: 'Defines the hostname and port of the proxy server.',
|
|
140
|
+
description: 'Defines the hostname and port of the proxy server. Connection only. Needs "allowInternalAddresses: true", since the server cannot check the address a proxy connects to.',
|
|
139
141
|
errorMessage: {
|
|
140
142
|
type: 'AxiosHttp property "proxy" should be an object.'
|
|
141
143
|
}
|
|
142
|
-
}
|
|
144
|
+
},
|
|
145
|
+
allowInternalAddresses: {
|
|
146
|
+
type: 'boolean',
|
|
147
|
+
default: false,
|
|
148
|
+
description: 'Allow requests to addresses that are not public: localhost, private networks (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), link-local addresses such as the cloud metadata endpoint, and the like. Set it to call a service on the same machine or network, such as a localhost API, a Docker service name or a private network API. Also needed for "socketPath", "proxy" and "httpVersion: 2". Connection only.',
|
|
149
|
+
errorMessage: {
|
|
150
|
+
type: 'AxiosHttp property "allowInternalAddresses" should be a boolean.'
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
allowedHosts: {
|
|
154
|
+
type: 'array',
|
|
155
|
+
items: {
|
|
156
|
+
type: 'string'
|
|
157
|
+
},
|
|
158
|
+
description: 'The hostnames requests may connect to, matched exactly and ignoring case (no wildcards or ports). A request to any other host, including a redirect to one, is refused. Applies alongside "allowInternalAddresses": an internal host must be listed and allowed. Connection only.',
|
|
159
|
+
errorMessage: {
|
|
160
|
+
type: 'AxiosHttp property "allowedHosts" should be an array of strings.'
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
httpAgentOptions: {
|
|
164
|
+
type: 'object',
|
|
165
|
+
description: 'Options for the Node.js http.Agent used by requests. Connection only.',
|
|
166
|
+
errorMessage: {
|
|
167
|
+
type: 'AxiosHttp property "httpAgentOptions" should be an object.'
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
httpsAgentOptions: {
|
|
171
|
+
type: 'object',
|
|
172
|
+
description: 'Options for the Node.js https.Agent used by requests. Connection only.',
|
|
173
|
+
errorMessage: {
|
|
174
|
+
type: 'AxiosHttp property "httpsAgentOptions" should be an object.'
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
socketPath: {
|
|
178
|
+
type: 'string',
|
|
179
|
+
description: 'A Unix socket to send requests to instead of a host. Needs "allowInternalAddresses: true". Connection only.',
|
|
180
|
+
errorMessage: {
|
|
181
|
+
type: 'AxiosHttp property "socketPath" should be a string.'
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
...createRefusedPropertiesSchema({
|
|
185
|
+
keys: unsupportedProperties,
|
|
186
|
+
reason: 'is not supported, since AxiosHttp sets it to check the address it connects to.'
|
|
187
|
+
})
|
|
143
188
|
}
|
|
144
189
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // Axios options that choose how a connection is made. AxiosHttp sets each of them itself, since
|
|
16
|
+
// any of them could open a socket the address check never sees (a fetch adapter, a custom
|
|
17
|
+
// transport or agent, a lookup), so neither a connection nor a request may set them.
|
|
18
|
+
const unsupportedProperties = [
|
|
19
|
+
'adapter',
|
|
20
|
+
'beforeRedirect',
|
|
21
|
+
'httpAgent',
|
|
22
|
+
'httpsAgent',
|
|
23
|
+
'lookup',
|
|
24
|
+
'transport'
|
|
25
|
+
];
|
|
26
|
+
export default unsupportedProperties;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/connection-axios-http",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -38,12 +38,13 @@
|
|
|
38
38
|
"dist/*"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@lowdefy/helpers": "7.
|
|
41
|
+
"@lowdefy/helpers": "7.4.0",
|
|
42
|
+
"@lowdefy/node-utils": "7.4.0",
|
|
42
43
|
"axios": "1.20.0"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
|
-
"@lowdefy/ajv": "7.
|
|
46
|
-
"@lowdefy/errors": "7.
|
|
46
|
+
"@lowdefy/ajv": "7.4.0",
|
|
47
|
+
"@lowdefy/errors": "7.4.0",
|
|
47
48
|
"@swc/cli": "0.8.1",
|
|
48
49
|
"@swc/core": "1.15.32",
|
|
49
50
|
"vitest": "4.1.12"
|