|
|
@ -3,13 +3,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
const nodeFetch = require('node-fetch');
|
|
|
|
const nodeFetch = require('node-fetch');
|
|
|
|
const https = require('https');
|
|
|
|
const https = require('https');
|
|
|
|
const { parse } = require('url');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const snodeHttpsAgent = new https.Agent({
|
|
|
|
const snodeHttpsAgent = new https.Agent({
|
|
|
|
rejectUnauthorized: false,
|
|
|
|
rejectUnauthorized: false,
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const LOKI_EPHEMKEY_HEADER = 'X-Loki-EphemKey';
|
|
|
|
|
|
|
|
const endpointBase = '/storage_rpc/v1';
|
|
|
|
const endpointBase = '/storage_rpc/v1';
|
|
|
|
|
|
|
|
|
|
|
|
// Request index for debugging
|
|
|
|
// Request index for debugging
|
|
|
@ -410,8 +408,6 @@ const lokiFetch = async (url, options = {}, targetNode = null) => {
|
|
|
|
const timeout = options.timeout || 10000;
|
|
|
|
const timeout = options.timeout || 10000;
|
|
|
|
const method = options.method || 'GET';
|
|
|
|
const method = options.method || 'GET';
|
|
|
|
|
|
|
|
|
|
|
|
const address = parse(url).hostname;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const fetchOptions = {
|
|
|
|
const fetchOptions = {
|
|
|
|
...options,
|
|
|
|
...options,
|
|
|
|
timeout,
|
|
|
|
timeout,
|
|
|
|