Comments (5)
You can check if the Host is equal to test.example.com
or if URI matches the regex https://test.example.com/.*
.
The URI and Access-Control-Allow-Origin header must start with the protocol, e.g. https://
.
from render.
I added an ALLOWED_ORIGINS env var (configurable in wrangler.toml) so you can set an access-control-allow-origin
value returned for every request.
Yeah, I believe public buckets will be introduced early next month(?) Not sure how useful this repository will be then.
from render.
There's no built-in way to do this with Render yet, I might add one in the future but I'm still undecided.
However, it should be possible to do this with transform rules:
(you can also set the expression to true
)
from render.
It would be really great to support headers in render, although in the meantime this sounds really interesting, I have never used the transformation rules, I can't get it to work, if for example this is the URL of the bucket test.example.com
, in the URI value I should put that URL and in the Access-Control-Allow-Origin value the URL example.com
(which would be the place where I want to allow the bucket content to be shown)?
I have done exactly the same but with test.example.com/*
to affect the rest of the objects but it doesn't seem to work.
from render.
Thank you very much indeed I managed to get it working, you completely saved my day :)
If it's ok with you I'll keep the issue open in case CORS handling is incorporated into Render (?) I think it's worth a look, also Vitali (Cloudflare developer) says it will come at some point but not soon, I thought it would with the public buckets in a couple of weeks, but that won't be the case, so it's a long way off...
from render.
Related Issues (19)
- 0-byte files cause issues HOT 6
- Music playing CORS/Cache/worker error HOT 4
- Turn off cache? HOT 4
- Cache hit ignored for 304 response HOT 2
- Remove `range-parser` dependency HOT 2
- List items in bucket HOT 13
- Etag needs to be quoted? HOT 2
- Add Edge-Side-Includes HOT 1
- Chinese characters may display as garbled text HOT 6
- File Not Found HOT 3
- Way to invalidate cache when object at R2 path changes? HOT 3
- Not all files listed HOT 5
- Remove type from <style> tag -- causes WC3 validation warning HOT 1
- add variable for HTML language declaration?
- how to upload HOT 2
- cache.put always fired HOT 2
- site showing errors always in the first requests to a file HOT 3
- "wrangler publish" fails, "Error: missing field `type`" HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from render.