Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MSC4108 'rendez-vous' responses with some reverse proxy in the front of Synapse #18178

Merged
merged 3 commits into from
Feb 25, 2025

Conversation

sandhose
Copy link
Member

@sandhose sandhose commented Feb 20, 2025

MSC4108 relies on ETag to determine if something has changed on the rendez-vous channel.
Strong and correct ETag comparison works if the response body is bit-for-bit identical, which isn't the case if a proxy in the middle compresses the response on the fly.

This adds a no-transform directive to the Cache-Control header, which tells proxies not to transform the response body.

Additionally, some proxies (nginx) will switch to Transfer-Encoding: chunked if it doesn't know the Content-Length of the response, and 'weakening' the ETag if that's the case. I've added Content-Length headers to all responses, to hopefully solve that.

This basically fixes QR-code login when nginx or cloudflare is involved, with gzip/zstd/deflate compression enabled.

@sandhose sandhose merged commit b9276e2 into develop Feb 25, 2025
39 checks passed
@sandhose sandhose deleted the quenting/rendezvous-headers branch February 25, 2025 10:34
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.

None yet

2 participants