aboutsummaryrefslogtreecommitdiff
path: root/background/cookie_filter.js
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2021-09-13 16:56:44 +0200
committerWojtek Kosior <koszko@koszko.org>2021-09-13 16:56:44 +0200
commit2bd35bc4b0d32b70320b06d932db90e75e89373e (patch)
treed38333de0b9cf54d31d35812784aeca367bea42e /background/cookie_filter.js
parent947fbdefffe0f6010e32abbfdce2f4b388d3f7f7 (diff)
downloadbrowser-extension-2bd35bc4b0d32b70320b06d932db90e75e89373e.tar.gz
browser-extension-2bd35bc4b0d32b70320b06d932db90e75e89373e.zip
rename the extension to "Haketilo"
Diffstat (limited to 'background/cookie_filter.js')
-rw-r--r--background/cookie_filter.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/background/cookie_filter.js b/background/cookie_filter.js
index fea2d23..64d18b2 100644
--- a/background/cookie_filter.js
+++ b/background/cookie_filter.js
@@ -1,7 +1,8 @@
/**
- * part of Hachette
- * Filtering request headers to remove hachette cookies that might have slipped
- * through.
+ * This file is part of Haketilo.
+ *
+ * Function: Filtering request headers to remove haketilo cookies that might
+ * have slipped through.
*
* Copyright (C) 2021 Wojtek Kosior
* Redistribution terms are gathered in the `copyright' file.
@@ -13,29 +14,29 @@
* IMPORTS_END
*/
-function is_valid_hachette_cookie(cookie)
+function is_valid_haketilo_cookie(cookie)
{
- const match = /^hachette-(\w*)=(.*)$/.exec(cookie);
+ const match = /^haketilo-(\w*)=(.*)$/.exec(cookie);
if (!match)
return false;
return !extract_signed(match.slice(1, 3)).fail;
}
-function remove_hachette_cookies(header)
+function remove_haketilo_cookies(header)
{
if (header.name !== "Cookie")
return header;
const cookies = header.value.split("; ");
- const value = cookies.filter(c => !is_valid_hachette_cookie(c)).join("; ");
+ const value = cookies.filter(c => !is_valid_haketilo_cookie(c)).join("; ");
return value ? {name: "Cookie", value} : null;
}
function filter_cookie_headers(headers)
{
- return headers.map(remove_hachette_cookies).filter(h => h);
+ return headers.map(remove_haketilo_cookies).filter(h => h);
}
/*