file proxy needs to be able to talk to snode

- disable TLS check for fileProxy
- lokiHttpsAgent => snodeHttpsAgent (since we use for two different things now)
pull/759/head
Ryan Tharp 5 years ago committed by GitHub
parent 3964e9acf0
commit aee63c3eae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -20,7 +20,7 @@ const MESSAGE_ATTACHMENT_TYPE = 'net.app.core.oembed';
const LOKI_ATTACHMENT_TYPE = 'attachment';
const LOKI_PREVIEW_TYPE = 'preview';
const lokiHttpsAgent = new https.Agent({
const snodeHttpsAgent = new https.Agent({
rejectUnauthorized: false,
});
@ -401,6 +401,8 @@ class LokiAppDotNetServerAPI {
'X-Loki-File-Server-Verb': 'POST',
'X-Loki-File-Server-Headers': JSON.stringify(finalRequestHeader),
},
// we are talking to a snode...
agent: snodeHttpsAgent,
};
const result = await nodeFetch(url, firstHopOptions);
@ -463,7 +465,7 @@ class LokiAppDotNetServerAPI {
// domain ends in .loki
if (url.match(/\.loki\//)) {
fetchOptions.agent = lokiHttpsAgent;
fetchOptions.agent = snodeHttpsAgent;
}
} catch (e) {
log.info('serverRequest set up error:', JSON.stringify(e));

Loading…
Cancel
Save