Skip to content

Commit caf05dd

Browse files
committed
fix
1 parent f303f75 commit caf05dd

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

spec/GraphQLQueryComplexity.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
const http = require('http');
44
const express = require('express');
5-
const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args));
5+
const fetch = (...args) =>
6+
import('node-fetch').then(({ default: fetch }) => {
7+
const [url, options = {}] = args;
8+
return fetch(url, { agent: new http.Agent({ keepAlive: false }), ...options });
9+
});
610
require('./helper');
711
const { ParseGraphQLServer } = require('../lib/GraphQL/ParseGraphQLServer');
812

spec/ParseGraphQLServer.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
const http = require('http');
22
const express = require('express');
33
const req = require('../lib/request');
4-
const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args));
4+
const fetch = (...args) =>
5+
import('node-fetch').then(({ default: fetch }) => {
6+
const [url, options = {}] = args;
7+
return fetch(url, { agent: new http.Agent({ keepAlive: false }), ...options });
8+
});
59
const FormData = require('form-data');
610
require('./helper');
711
const { updateCLP } = require('./support/dev');

spec/vulnerabilities.spec.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
const http = require('http');
22
const express = require('express');
3-
const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args));
3+
const fetch = (...args) =>
4+
import('node-fetch').then(({ default: fetch }) => {
5+
const [url, options = {}] = args;
6+
return fetch(url, { agent: new http.Agent({ keepAlive: false }), ...options });
7+
});
48
const ws = require('ws');
59
const request = require('../lib/request');
610
const Config = require('../lib/Config');

0 commit comments

Comments
 (0)