Skip to content

Send same-origin cookies, so the reader works behind a login - #7

Merged
zordhalo merged 1 commit into
mainfrom
fix/same-origin-credentials
Oct 29, 2026
Merged

zordhalo merged 1 commit into
mainfrom
fix/same-origin-credentials

Conversation

@zordhalo

Copy link
Copy Markdown
Contributor

Problem

Both fetches used credentials: "omit". On a site behind a login (a Vercel preview with Deployment Protection, an intranet), the cookieless request is redirected to the login page:

  • The llms.txt probe fails and the pill never appears.
  • Or the reader's fetch fails and Machine falls back to navigating to the raw file, with no reader and no pill.

Seen on advancelabs.dev's preview deployment.

Fix

Both fetches use credentials: "same-origin". The visitor's cookies go only to the site's own origin, so a cross-origin data-llms URL still gets none. No behaviour change on public sites.

Checks

  • npm test: 35 pass, including a new test that no fetch drops same-origin cookies.

Follow-up

The WordPress plugin pins HMV_COMPONENT_VERSION 1.4.0 with SRI, so it needs its own bump to pick this up.

🤖 Generated with Claude Code

Both fetches (the llms.txt probe and the reader) used credentials: "omit". On a deployment
behind a login, such as a Vercel preview with Deployment Protection, the cookieless request was
redirected to the login page: the probe failed, or the reader's fetch failed and Machine fell
back to navigating to the raw file, with no reader and no pill. same-origin sends the visitor's
cookies only to the site's own origin, so a cross-origin data-llms URL still gets none.

Adds a test that no fetch drops same-origin cookies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@zordhalo
zordhalo merged commit 5e55148 into main Oct 29, 2026
2 checks passed
@zordhalo
zordhalo deleted the fix/same-origin-credentials branch October 29, 2026 21:45
zordhalo added a commit that referenced this pull request Oct 29, 2026
Follow-up to #7. The reader now fetches with same-origin cookies, so the URL it fetches must
not be choosable by markup page content can inject: a <link rel="llms"> in the body is
ignored. Every documented install already puts it in <head>; the README now says so.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant