Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
Exclude .onion requests from being upgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
Pasu Chan Chak Shing committed Feb 14, 2018
1 parent 1e06bf1 commit e4b17e8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions chromium/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,13 @@ function onErrorOccurred(details) {
*/
function onHeadersReceived(details) {
if (isExtensionEnabled && httpNowhereOn) {
// Do not upgrade the .onion requests in HTTP Nowhere Mode,
// See https://github.com/EFForg/https-everywhere/pull/14600#discussion_r168072480
const uri = new URL(details.url);
if (uri.hostname.slice(-6) == '.onion') {
return {responseHeaders: details.responseHeaders};
}

for (const idx in details.responseHeaders) {
if (details.responseHeaders[idx].name.match(/Content-Security-Policy/i)) {
// Existing CSP headers found
Expand Down

0 comments on commit e4b17e8

Please sign in to comment.