only delete origin header for sdk calls - leave everything else as is

This commit is contained in:
Sean Yesmunt 2020-06-08 11:52:21 -04:00
parent 339ebf2d32
commit a8c3ec54ae
2 changed files with 10 additions and 2 deletions

View file

@ -158,7 +158,9 @@ if (!gotSingleInstanceLock) {
// By default, electron sends http://localhost:{port} as the origin for POST requests // By default, electron sends http://localhost:{port} as the origin for POST requests
// https://github.com/electron/electron/issues/7931#issuecomment-361759277 // https://github.com/electron/electron/issues/7931#issuecomment-361759277
session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => { 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 }); callback({ cancel: false, requestHeaders: details.requestHeaders });
}); });
}); });

View file

@ -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.", "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", "%view_count% Views": "%view_count% Views",
"This channel hasn't published anything yet": "This channel hasn't published anything yet", "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."
} }