Skip to content
Snippets Groups Projects
Commit cb8e35fd authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

make anonymous token empty when setting is disabled

parent 4614c58d
No related branches found
No related tags found
No related merge requests found
......@@ -99,18 +99,19 @@ export class TokenManager {
let [headers, cookies] = this._parseRequestHeadersForCookies(
details.requestHeaders
);
if (!this.urlRequiresKey(url)) {
cookies = this.hideMetaGerKey(cookies);
}
let token_header = null;
if (this._tokens_attach == true && this._recent_costs.length > 0 && url.pathname == "/meta/meta.ger3") {
let token_header = await this._create_token_header();
token_header = await this._create_token_header();
if (token_header != null) {
headers.push(token_header);
}
}
if (!this.urlRequiresKey(url) && (this._anonymous_tokens_enabled || !this._tokens_attach || token_header != null)) {
cookies = this.hideMetaGerKey(cookies);
}
let request_cookies = [];
for (let key in cookies) {
let value = cookies[key];
......@@ -225,8 +226,6 @@ export class TokenManager {
* https://gitlab.metager.de/open-source/MetaGer/-/wikis/Anonymous%20Token%20System
*/
hideMetaGerKey(cookies) {
if (this._anonymous_tokens_enabled == false) return cookies;
// Set the tokenauthorization cookie instead of the actual key
let token_authorization = "empty";
if (this._key_charge > 30) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment