Spaces:
Sleeping
Sleeping
Fix: disable XSRF/CORS so file uploads work behind HF proxy (403 fix)
Browse files- .streamlit/config.toml +10 -9
.streamlit/config.toml
CHANGED
|
@@ -15,15 +15,16 @@ font = "sans serif"
|
|
| 15 |
toolbarMode = "minimal"
|
| 16 |
|
| 17 |
# --- Server settings -------------------------------------------------------
|
| 18 |
-
#
|
| 19 |
-
#
|
| 20 |
-
#
|
| 21 |
-
#
|
| 22 |
#
|
| 23 |
-
#
|
| 24 |
-
#
|
| 25 |
-
#
|
| 26 |
-
#
|
| 27 |
[server]
|
| 28 |
maxUploadSize = 50 # max upload size per file, in MB (dossier + screenshot)
|
| 29 |
-
|
|
|
|
|
|
| 15 |
toolbarMode = "minimal"
|
| 16 |
|
| 17 |
# --- Server settings -------------------------------------------------------
|
| 18 |
+
# st.file_uploader is core to this app (dossier files + job screenshot). Behind
|
| 19 |
+
# Hugging Face's reverse proxy, Streamlit's XSRF check rejects the upload POST
|
| 20 |
+
# with "AxiosError: Request failed with status code 403", so both XSRF and CORS
|
| 21 |
+
# are disabled here to make uploads work on the Space.
|
| 22 |
#
|
| 23 |
+
# Security note: this is acceptable for THIS app because there is no persistent
|
| 24 |
+
# server-side session to forge against — each visitor supplies their own API
|
| 25 |
+
# key, held only in their own in-memory session, and nothing is stored
|
| 26 |
+
# server-side. There is no privileged state a cross-site request could abuse.
|
| 27 |
[server]
|
| 28 |
maxUploadSize = 50 # max upload size per file, in MB (dossier + screenshot)
|
| 29 |
+
enableCORS = false # required alongside the XSRF setting below
|
| 30 |
+
enableXsrfProtection = false # clears the 403 upload error on Hugging Face
|