Coder Social home page Coder Social logo

Comments (5)

kotx avatar kotx commented on June 22, 2024 1

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.

kotx avatar kotx commented on June 22, 2024 1

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.

kotx avatar kotx commented on June 22, 2024

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:
screenshot of a transform rule that allows all CORS
(you can also set the expression to true)

from render.

iamdarkle avatar iamdarkle commented on June 22, 2024

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.

iamdarkle avatar iamdarkle commented on June 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.