Repository navigation
Let another origin read changelog.json (GRYT-1101) - #121
Merged
Merged
Conversation
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The what's-new dialog fetches
https://gryt.chat/changelog.json. Every client that does is on a different origin, and nginx sent noAccess-Control-Allow-Origin, so the browser refused all of them and the dialog's.catchswallowed it silently.http://127.0.0.1:<port>— its embedded server (electron/main.tsloadURL(localServerUrl)).app.gryt.chatandbeta.gryt.chatare different hosts fromgryt.chat.Its own
locationnow, 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 okGET /changelog.jsonwith anOriginheader → 200 +Access-Control-Allow-Origin: *and the expectedCache-ControlGET /→ no CORS header, so the scoping is rightBefore this,
curl -I https://gryt.chat/changelog.jsonreturns noaccess-control-*header at all.Half of GRYT-1101. The client half is Gryt-chat/client#516.
🤖 Generated with Claude Code