Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'trust site' on localhost #491

Merged
merged 5 commits into from Feb 3, 2020
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next

Handle localhost port number when trusting localhost

  • Loading branch information
benstrumeyer committed Jan 27, 2020
commit 999c18cd9776dc8eeb0a7419c50842ec723c15f2
@@ -111,9 +111,17 @@ const _updateSitePolicy = (state, action) => {
// Handles extension pages. Adds the extension ID to the white/black list
const pageUrlTokens = pageUrl.split('/');
host = pageUrlTokens.length > 2 ? pageUrlTokens[2] : pageHost.replace(/^www\./, '');
} else if (pageHost === 'localhost') {
// Handle localhost port number
if (pageUrl.includes(':')) {
const port = pageUrl.split(':');
host = `localhost:${port[port.length - 1]}`;
host = host.substring(0, host.length - 1);
}
} else {
host = pageHost.replace(/^www\./, '');
}

let updated_site_policy;
let updated_blacklist = site_blacklist.slice(0);
let updated_whitelist = site_whitelist.slice(0);
ProTip! Use n and p to navigate between commits in a pull request.