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

Open
#599 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

  • #639 by @singhvishalkr — closed without merging
  • #642 by @singhvishalkr — closed without merging

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Documentation
Clarity
Needs clarification
Activity status
Stale
Domain
api, documentation

Research direction

Start by reviewing the existing TUS upload and CORS documentation, then verify how Directus-File-Id and CORS_EXPOSED_HEADERS behave for browser requests from external domains. Done means the relevant guidance explains the required configuration and clearly records whether the API exposes the header by default.

Written by the indexing model from the issue text.

Description

Describe the Bug

With TUS file uploads, a Directus-File-Id HTTP header is returned instead of a proper response object. But it took me several hours to understand why i could not access it on the browser side, because I simply forget to set :

CORS_EXPOSED_HEADERS: "Directus-File-Id"

I don't know the potential security issues with enabling this by default, so I'm only asking this as a question : should the api return Access-Control-Expose-Headers: Directus-File-Id alongside the header ?

To Reproduce

…

Directus Version

v11.16.1

Hosting Strategy

Self-Hosted (Docker Image)

Database

No response

Dominant language
TypeScript
Stars
24
Forks
90
Avg merge
3d 22h
Merged PRs (30d)
19

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from directus/docs

All issues in directus/docs

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.