Files
loki/scripts
CatoandClaude Opus 5 28de8ac62e feat(newsletter): let the studio site join the list, and say so out loud (#762)
The studio site's /hire/ page stops publishing rates and offers a waitlist
instead. It is a static page on another origin, so a JSON POST to
/api/newsletter triggers a preflight this route did not answer, and a row
landed in a table with no sending pipeline — capture-only by design, which
is fine for a newsletter nobody has sent and wrong for a page that promises
a human writes back when capacity opens.

CORS, but an allowlist. The feedback widget can afford
`Access-Control-Allow-Origin: *` because its fcw_* token is the real gate.
This route has no token and writes a row per call, so it echoes one
allowlisted origin at a time (src/lib/api/public-cors.ts) and varies on
Origin, and an unknown origin gets no ACAO at all. The 429 carries the
headers too: a cross-origin refusal the browser cannot read is a refusal
the visitor cannot be told about.

A new row now announces itself on Telegram, through the channel's existing
contract — fire at the insert choke point, never throw, never slow the
response, and stay silent when the operator must not act. subscribeToNewsletter
returns whether it actually inserted, so a repeat signup is still a silent
no-op; the visitor is told the same thing either way. Registered in
docs/telegram-notifications.md, as the gate requires.

Proven by mutation, not by a green run: setting ACAO to "*" fails the new
test with "an allowlisted origin must be echoed back verbatim", and the
allowlist test also refuses a prefix match (bitbaum.orangecat.ch.evil.test),
a scheme downgrade, a null origin and a missing one. 191/191 unit files pass.


Claude-Session: https://claude.ai/code/session_01DzY8KuwgUM7u95GVTpRL2m

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 05:00:18 -07:00
..
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00
2026-08-31 09:23:30 +00:00