Ordnary

Docs Ordnary Web Services Ordnary R2

CORS policy

Letting browsers on other origins read from or upload to a bucket: the rule fields and the usual setups.

3 min readIntermediate

A browser only lets a page call a different origin when that origin allows it. Without a CORS policy, a script on your site cannot fetch from the bucket's public domain or upload to it with a presigned URL. Plain <img> and <a> tags do not need CORS.

Rules

originslistRequired
The sites allowed, such as https://app.example.com. Use * to allow every origin for public reads.
methodslistRequired
GET and HEAD for reads; PUT, POST and DELETE for uploads from the browser.
headerslist
Request headers the browser may send, such as Content-Type or x-amz-* headers for uploads.
exposeHeaderslist
Response headers scripts may read, such as ETag.
maxAgeSecondsnumber
How long the browser caches the preflight answer.

Typical setups

Scripts on any site may fetch objects from the public domain.

json
[
  { "origins": ["*"], "methods": ["GET", "HEAD"], "maxAgeSeconds": 86400 }
]
Was this page helpful?
Updated 25 October 2026 Suggest an edit

Choose which cookies Ordnary may use. You can change this at any time via Cookie settings at the bottom of every page.