Skip to content

Commit 5303710

Browse files
authored
feat(metrics): tag cryptify uploads with X-Cryptify-Source: thunderbird (#121)
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://<uuid>` 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.
1 parent 52d332f commit 5303710

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/background/background.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ const extVersion = browser.runtime.getManifest().version;
171171

172172
PG_CLIENT_HEADER = {
173173
"X-PostGuard-Client-Version": `Thunderbird,${tbVersion},pg4tb,${extVersion}`,
174+
// Identifies this add-in in cryptify's per-channel upload metrics
175+
// (encryption4all/cryptify#102). Explicit header avoids relying on
176+
// cryptify's Origin/User-Agent fallbacks, which are environment- and
177+
// host-dependent.
178+
"X-Cryptify-Source": "thunderbird",
174179
};
175180

176181
console.log(`[PostGuard] v${extVersion} started (Thunderbird ${tbVersion})`);

0 commit comments

Comments
 (0)