You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
R2 local S3 endpoint: "Cross-origin requests are always allowed" only after the /cdn-cgi host gate #35249
The docs say cross-origin requests to the local S3 endpoint are always allowed, as if the bucket had a permissive CORS policy. In practice (wrangler 4.159.0):
An OPTIONS preflight with Origin: http://localhost:<port> returns 204 with Access-Control-Allow-Origin: *.
The same preflight with any non-localhost Origin (e.g. https://your-app.example.com, even behind a reverse proxy) returns 403 "Invalid Origin header" from Miniflare's /cdn-cgi/* host validation (validateCdnCgiRequest), before the S3 endpoint's permissive CORS is ever reached.
So the "always allowed" statement is true of the S3 layer, but the outer gate makes browser use impossible unless the app itself runs on localhost. Suggest documenting the gate (and pointing to workers-sdk#16423) so developers testing browser uploads against the local endpoint are not surprised by the 403.
Activity