Skip to content

Fix Safari ITP submission failure on /new_submission#67

Draft
eduardosanchezg wants to merge 1 commit into
huggingface:mainfrom
eduardosanchezg:t66_safari_new_submission_bug
Draft

Fix Safari ITP submission failure on /new_submission#67
eduardosanchezg wants to merge 1 commit into
huggingface:mainfrom
eduardosanchezg:t66_safari_new_submission_bug

Conversation

@eduardosanchezg

Copy link
Copy Markdown

On Safari, the HF Space proxy requires the __sign JWT token to authenticate requests. Safari's Intelligent Tracking Prevention (ITP) blocks the session cookie that Chrome uses, so POST requests to /new_submission are rejected by the proxy before reaching uvicorn, returning an HTML 401 instead of JSON. response.json() then throws SyntaxError: The string did not match the expected pattern (Safari's wording for a JSON parse failure).

Fix: Extract __sign from the current page URL and forward it on the POST, plus add credentials: 'include' to ensure cookies are sent where available.

@eduardosanchezg eduardosanchezg marked this pull request as draft June 12, 2026 02:52
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