Skip to content

docs(files): note CORS_EXPOSED_HEADERS requirement for TUS Directus-File-Id#642

Closed
singhvishalkr wants to merge 1 commit intodirectus:mainfrom
singhvishalkr:docs-599-tus-cors-exposed-headers
Closed

docs(files): note CORS_EXPOSED_HEADERS requirement for TUS Directus-File-Id#642
singhvishalkr wants to merge 1 commit intodirectus:mainfrom
singhvishalkr:docs-599-tus-cors-exposed-headers

Conversation

@singhvishalkr
Copy link
Copy Markdown

Fixes #599.

v11.16+ returns the uploaded file's ID in a Directus-File-Id response header after a TUS chunked upload. When the frontend is on a different origin from the API, browsers don't expose that header to JavaScript unless it's listed in Access-Control-Expose-Headers, so reading the ID from xhr.getResponseHeader('Directus-File-Id') silently returns null.

I hit this myself and spent a while staring at the Network tab before finding the issue, which is also the exact gotcha the report describes. ComfortablyCoding confirmed on the issue that the right fix is documentation -- not a default change -- so I added a small callout in the existing Chunked Uploads section pointing at CORS_EXPOSED_HEADERS on the Security & Limits page.

No variable or behavior changes, just the note.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

@singhvishalkr is attempting to deploy a commit to the Directus Team on Vercel.

A member of the Team first needs to authorize it.

@singhvishalkr
Copy link
Copy Markdown
Author

Superseded by the earlier #639 in this same session, which also calls out the same-origin exclusion and the comma-separated CORS_EXPOSED_HEADERS shape; closing this one to avoid double review. Tracking on #639.

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.

Document Directus-File-Id header for TUS needs CORS_EXPOSED_HEADERS set for external domains

1 participant