From 8d0860b7c7be1aad6d9a549e2f0daf688202ce8f Mon Sep 17 00:00:00 2001 From: Ruben Hensen Date: Mon, 18 May 2026 17:39:33 +0200 Subject: [PATCH] feat(metrics): tag cryptify uploads with X-Cryptify-Source: thunderbird Adds X-Cryptify-Source: thunderbird to PG_CLIENT_HEADER so cryptify's per-channel upload metrics (encryption4all/cryptify#102) classify this add-in deterministically rather than via the User-Agent substring fallback. Thunderbird WebExtensions don't always present a stable Origin (can be `moz-extension://` or null), and the User-Agent fallback is the last layer of cryptify's detect_channel. Setting the explicit header at the source removes any environment-dependent ambiguity and is symmetric with parallel PRs in postguard-website and postguard-outlook-addon. --- src/background/background.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/background/background.ts b/src/background/background.ts index 98b6aba..1ac0cba 100644 --- a/src/background/background.ts +++ b/src/background/background.ts @@ -171,6 +171,11 @@ const extVersion = browser.runtime.getManifest().version; PG_CLIENT_HEADER = { "X-PostGuard-Client-Version": `Thunderbird,${tbVersion},pg4tb,${extVersion}`, + // Identifies this add-in in cryptify's per-channel upload metrics + // (encryption4all/cryptify#102). Explicit header avoids relying on + // cryptify's Origin/User-Agent fallbacks, which are environment- and + // host-dependent. + "X-Cryptify-Source": "thunderbird", }; console.log(`[PostGuard] v${extVersion} started (Thunderbird ${tbVersion})`);