@goodandready/dsh-usage-guard 0.1.17 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/telemetry.js +9 -4
  2. package/package.json +1 -1
package/lib/telemetry.js CHANGED
@@ -124,12 +124,17 @@ export function isTrustedSettingsRequest(request, options = {}) {
124
124
  if (referer) {
125
125
  try {
126
126
  const url = new URL(referer);
127
- if (host && url.host.toLowerCase() === host.toLowerCase()) {
128
- return true;
127
+ // Apply strict host matching only to standard web referers (http/https).
128
+ // Non-http schemes (e.g. dsh-app:// in DSH Desktop Electron forwarder)
129
+ // fall through to loopback and token verification (#55).
130
+ if (url.protocol === 'http:' || url.protocol === 'https:') {
131
+ if (host && url.host.toLowerCase() === host.toLowerCase()) {
132
+ return true;
133
+ }
134
+ return false;
129
135
  }
130
- return false;
131
136
  } catch {
132
- return false;
137
+ // Non-standard or unparseable referers fall through to auth/loopback checks
133
138
  }
134
139
  }
135
140
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-usage-guard",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Keeps a malformed token-usage sample from taking a whole session history down with it: a missing or non-numeric counter becomes zero before the harness adds it up, so the fold never yields NaN and already-broken sessions open again.",
5
5
  "keywords": [
6
6
  "deepseek-harness",