Skip to content

Let another origin read changelog.json (GRYT-1101) - #121

Merged
sivert-io merged 1 commit into
mainfrom
claude/GRYT-1101-changelog-cors
Sep 9, 2026
Merged

sivert-io merged 1 commit into
mainfrom
claude/GRYT-1101-changelog-cors

Conversation

@sivert-io

Copy link
Copy Markdown
Member

The what's-new dialog fetches https://gryt.chat/changelog.json. Every client that does is on a different origin, and nginx sent no Access-Control-Allow-Origin, so the browser refused all of them and the dialog's .catch swallowed it silently.

  • The desktop app loads from http://127.0.0.1:<port> — its embedded server (electron/main.ts loadURL(localServerUrl)).
  • app.gryt.chat and beta.gryt.chat are different hosts from gryt.chat.

Its own location now, with the header and the same ten-minute cache the rest of the site gets. Public unauthenticated JSON, so * rather than a list of origins nobody will remember to extend.

Checked

I extracted the config the Dockerfile writes and ran nginx against it in a container:

  • nginx -t — syntax ok
  • GET /changelog.json with an Origin header → 200 + Access-Control-Allow-Origin: * and the expected Cache-Control
  • GET / → no CORS header, so the scoping is right

Before this, curl -I https://gryt.chat/changelog.json returns no access-control-* header at all.

Half of GRYT-1101. The client half is Gryt-chat/client#516.

🤖 Generated with Claude Code

The what's-new dialog fetches https://gryt.chat/changelog.json, and every
client that does is on a different origin: the desktop app loads from
http://127.0.0.1 and its embedded server, app.gryt.chat and beta.gryt.chat are
different hosts. nginx sent no Access-Control-Allow-Origin, so the browser
refused every one of those reads and the dialog's catch swallowed it.

Its own location now, with the header and the same ten-minute cache the rest of
the site gets. Public unauthenticated JSON, so `*` rather than a list of
origins nobody will remember to extend.

Checked by extracting the config the Dockerfile writes and running nginx
against it: `nginx -t` passes, /changelog.json answers 200 with the header, and
/ still answers without one.

Co-Authored-By: Claude Opus 5 <[email protected]>
@sivert-io
sivert-io merged commit d64fd2f into main Sep 9, 2026
3 checks passed
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