force headers to be empty for onion_req request

pull/1783/head
Audric Ackermann 4 years ago
parent 32cb19125f
commit aead3d6510
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -1,4 +1,4 @@
import { default as insecureNodeFetch } from 'node-fetch';
import { default as insecureNodeFetch, RequestInit } from 'node-fetch';
import https from 'https';
import { dropSnodeFromSnodePool, dropSnodeFromSwarmIfNeeded, updateSwarmFor } from './snodePool';
@ -793,15 +793,19 @@ const sendOnionRequest = async ({
const guardNode = nodePath[0];
const guardFetchOptions = {
const guardFetchOptions: RequestInit = {
method: 'POST',
body: payload,
// we are talking to a snode...
agent: snodeHttpsAgent,
abortSignal,
timeout: 5000,
headers: {},
timeout: 10000,
};
if (abortSignal) {
guardFetchOptions.signal = abortSignal as any;
}
const guardUrl = `https://${guardNode.ip}:${guardNode.port}/onion_req/v2`;
// no logs for that one insecureNodeFetch as we do need to call insecureNodeFetch to our guardNode
// window?.log?.info('insecureNodeFetch => plaintext for sendOnionRequest');

Loading…
Cancel
Save