Skip to content

fix: echo request Origin for /storage so credentialed cross-origin fetches work#2439

Merged
hsluoyz merged 1 commit into
the-open-agent:masterfrom
lulululu-debug:fix/storage-cors-credentials
Jul 6, 2026
Merged

fix: echo request Origin for /storage so credentialed cross-origin fetches work#2439
hsluoyz merged 1 commit into
the-open-agent:masterfrom
lulululu-debug:fix/storage-cors-credentials

Conversation

@lulululu-debug

Copy link
Copy Markdown
Contributor

Summary

The static file route replied with Access-Control-Allow-Origin: * while also sending Access-Control-Allow-Credentials: true. Browsers reject a wildcard Allow-Origin on a credentialed request, so the file-preview fetch (which uses credentials: "include") failed with "Failed to fetch" whenever the frontend and backend are served from different origins — e.g. the dev server on :13001 hitting the backend on :14000. Echo the request Origin instead (matching what CorsFilter already does for /api), falling back to "*" for same-origin / non-CORS requests.

…oss-origin

The static file route replied with Access-Control-Allow-Origin: * while also
sending Access-Control-Allow-Credentials: true. Browsers reject a wildcard
Allow-Origin on a credentialed request, so the file-preview fetch (which uses
credentials: "include") failed with "Failed to fetch" whenever the frontend and
backend are served from different origins — e.g. the dev server on :13001
hitting the backend on :14000. Echo the request Origin instead (matching what
CorsFilter already does for /api), falling back to "*" for same-origin / non-CORS
requests.
@hsluoyz
hsluoyz merged commit 317889a into the-open-agent:master Jul 6, 2026
7 checks passed
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.

2 participants