From a8c3ec54ae401813ebe14f6749c43d938c0fc569 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 8 Jun 2020 11:52:21 -0400 Subject: [PATCH] only delete origin header for sdk calls - leave everything else as is --- electron/index.js | 4 +++- static/app-strings.json | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/electron/index.js b/electron/index.js index 6f39e35c5..2af54625a 100644 --- a/electron/index.js +++ b/electron/index.js @@ -158,7 +158,9 @@ if (!gotSingleInstanceLock) { // By default, electron sends http://localhost:{port} as the origin for POST requests // https://github.com/electron/electron/issues/7931#issuecomment-361759277 session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => { - delete details.requestHeaders['Origin']; + if (details.method === 'POST' && details.requestHeaders['Content-Type'] === 'application/json-rpc') { + delete details.requestHeaders['Origin']; + } callback({ cancel: false, requestHeaders: details.requestHeaders }); }); }); diff --git a/static/app-strings.json b/static/app-strings.json index 62c59f64d..f73890cc4 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -1204,5 +1204,11 @@ "No information will be sent directly to LBRY, Inc. or third-parties about your usage. Note that as\n peer-to-peer software, your IP address and potentially other system information can be sent to other\n users, though this information is not stored permanently.": "No information will be sent directly to LBRY, Inc. or third-parties about your usage. Note that as\n peer-to-peer software, your IP address and potentially other system information can be sent to other\n users, though this information is not stored permanently.", "%view_count% Views": "%view_count% Views", "This channel hasn't published anything yet": "This channel hasn't published anything yet", - "Buy": "Buy" + "Buy": "Buy", + "Buy LBRY Credits": "Buy LBRY Credits", + "Country": "Country", + "Only some countries are eligible at this time. We are working to make this available to everyone.": "Only some countries are eligible at this time. We are working to make this available to everyone.", + "Select your country": "Select your country", + "LBRY, Inc. partners with Moonpay to provide the option to purchase LBC. %learn_more%.": "LBRY, Inc. partners with Moonpay to provide the option to purchase LBC. %learn_more%.", + "Your browser does not support iframes.": "Your browser does not support iframes." } \ No newline at end of file