summaryrefslogtreecommitdiffstats
path: root/devtools/server/actors/storage.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-04 01:58:43 +0100
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-03-04 01:58:43 +0100
commite78a87b4188fd266d6ec9662c95ef147dbbd92cd (patch)
tree0b0cf0ab3b3596ea43e57e59dfaca46c4ff2324c /devtools/server/actors/storage.js
parenta53fe8f5c92ceeb091df55ce41b69f49f7d6c6d6 (diff)
downloadUXP-e78a87b4188fd266d6ec9662c95ef147dbbd92cd.tar
UXP-e78a87b4188fd266d6ec9662c95ef147dbbd92cd.tar.gz
UXP-e78a87b4188fd266d6ec9662c95ef147dbbd92cd.tar.lz
UXP-e78a87b4188fd266d6ec9662c95ef147dbbd92cd.tar.xz
UXP-e78a87b4188fd266d6ec9662c95ef147dbbd92cd.zip
moebius#346: Storage Inspector should trim port from hosts for cookies
Issue #31 https://github.com/MoonchildProductions/moebius/pull/346
Diffstat (limited to 'devtools/server/actors/storage.js')
-rw-r--r--devtools/server/actors/storage.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/devtools/server/actors/storage.js b/devtools/server/actors/storage.js
index a7215b152..c702e8145 100644
--- a/devtools/server/actors/storage.js
+++ b/devtools/server/actors/storage.js
@@ -494,7 +494,7 @@ StorageActors.createActor({
return host == null;
}
- host = trimHttpHttps(host);
+ host = trimHttpHttpsPort(host);
if (cookie.host.startsWith(".")) {
return ("." + host).endsWith(cookie.host);
@@ -761,7 +761,7 @@ var cookieHelpers = {
host = "";
}
- host = trimHttpHttps(host);
+ host = trimHttpHttpsPort(host);
let cookies = Services.cookies.getCookiesFromHost(host, originAttributes);
let store = [];
@@ -897,7 +897,7 @@ var cookieHelpers = {
opts.path = split[2];
}
- host = trimHttpHttps(host);
+ host = trimHttpHttpsPort(host);
function hostMatches(cookieHost, matchHost) {
if (cookieHost == null) {
@@ -2452,7 +2452,12 @@ exports.setupParentProcessForIndexedDB = function ({ mm, prefix }) {
/**
* General helpers
*/
-function trimHttpHttps(url) {
+function trimHttpHttpsPort(url) {
+ let match = url.match(/(.+):\d+$/);
+
+ if (match) {
+ url = match[1];
+ }
if (url.startsWith("http://")) {
return url.substr(7);
}