web-comments 1.0.0 → 1.0.1

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.
@@ -302,9 +302,16 @@ var PAGE_HEADERS = {
302
302
  "cache-control": "no-store",
303
303
  "content-security-policy": "default-src 'none'; style-src 'unsafe-inline'; img-src https: data:; frame-ancestors 'none'; base-uri 'none'",
304
304
  "x-frame-options": "DENY",
305
- "referrer-policy": "no-referrer",
305
+ // Not no-referrer: under it, browsers send the consent form's Origin as "null".
306
+ "referrer-policy": "same-origin",
306
307
  "x-content-type-options": "nosniff"
307
308
  };
309
+ function fromThisOrigin(request) {
310
+ const site = request.headers.get("sec-fetch-site");
311
+ if (site) return site === "same-origin";
312
+ const origin = request.headers.get("origin");
313
+ return origin === null || origin === new URL(request.url).origin;
314
+ }
308
315
  function page(html, status = 200) {
309
316
  return new Response(html, { status, headers: PAGE_HEADERS });
310
317
  }
@@ -387,9 +394,7 @@ async function authorize(request, context, options) {
387
394
  }
388
395
  async function decide(request, context, options) {
389
396
  const at = endpoints(context.url);
390
- const ownOrigin = new URL(request.url).origin;
391
- const origin = request.headers.get("origin");
392
- if (origin !== null && origin !== ownOrigin || request.headers.get("sec-fetch-site") === "cross-site") {
397
+ if (!fromThisOrigin(request)) {
393
398
  return page(
394
399
  messagePage(options.name, "Not allowed", "This approval didn't come from this site."),
395
400
  403
@@ -540,7 +545,7 @@ async function handleOAuth(request, path, context, options) {
540
545
  }
541
546
 
542
547
  // src/connectors/mcp/index.ts
543
- var VERSION = "1.0.0";
548
+ var VERSION = "1.0.1";
544
549
  var PROTOCOL_VERSIONS = ["2025-11-25", "2025-06-18", "2025-03-26", "2024-11-05"];
545
550
  function mcp(options = {}) {
546
551
  const oauth = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-comments",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Figma-style comments for any web page: drop a comment on an element, reply, resolve. Bring your own sign-in, database and screenshot storage; send threads to Linear, or to agents over MCP.",
5
5
  "keywords": [
6
6
  "annotations",