Repository navigation
fix(viewer): turn off Mesop debug mode in production - #726
Draft
omkargaikwad23 wants to merge 3 commits into
Draft
omkargaikwad23 wants to merge 3 commits into
omkargaikwad23 wants to merge 3 commits into
Conversation
MESOP_XSRF_CHECK=false set the Mesop debug mode, which turns off the check for cross-site requests. Ignore the variable and remove it from the Makefile targets and the deployment checklist.
Collaborator
Author
|
/gcbrun |
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.
What this fixes
MESOP_XSRF_CHECK=falseturned on the Mesop debug mode in the viewer. Themake containerandmake deploy-corpruntargets set this variable, so the deployed viewer ran in debug mode.In debug mode, Mesop:
How
MESOP_XSRF_CHECK=falseand logs a warning.Proxy check
Mesop compares the
Originheader with the URL of the request. If a proxy changes the host or the scheme, each UI request gets HTTP 403.A check on 2026-11-20 behind the Cloud Run proxy passed. A temporary second service ran the image of the deployed viewer without
MESOP_XSRF_CHECK, so the debug mode was off. Each tab of the UI opened, and each UI request got HTTP 200. Internal links: log, screenshot.Behavior change
A client that is not a browser and sends no
Originheader gets HTTP 403 from the UI endpoint.Testing
MESOP_XSRF_CHECK=false: a cross-site POST to/__ui__gets HTTP 403. Before this change, the check accepted it. A same-origin POST still passes the check..ci/verify_viewer.pypasses.evalbench/testsuite runs in CI for this PR.