GithubHelp home page GithubHelp logo

CORS Headers about imgproxy HOT 6 CLOSED

imgproxy avatar imgproxy commented on May 13, 2024
CORS Headers

from imgproxy.

Comments (6)

DarthSim avatar DarthSim commented on May 13, 2024 2

HI.
I'm very sorry for the long period of inactivity.

CORS headers were added to the latest release. You need to set IMGPROXY_ALLOW_ORIGIN to enable them. See README.

from imgproxy.

mattsrobot avatar mattsrobot commented on May 13, 2024

@DarthSim is it possible to allow multiple domains? I have two domains, one also that supports subdomains, using the image proxy, I'de like to restrict access only from these?

from imgproxy.

uncvrd avatar uncvrd commented on May 13, 2024

Following up on Matt's request for the ability to allow multiple domains in the IMGPROXY_ALLOW_ORIGIN if possible. Currently have to set to * to suit my needs but would like to restrict!

from imgproxy.

DarthSim avatar DarthSim commented on May 13, 2024

Here's the thing: Access-Control-Allow-Origin does not support multiple values and masking. Usually, applications respond with dynamic Access-Control-Allow-Origin that depends on the request origin. But in the case of imgproxy where you put a CDN or a caching server in front, this won't work properly.

from imgproxy.

thibauds avatar thibauds commented on May 13, 2024

@DarthSim Maybe we could check if the Host or X-Forwarded-Host header is in the IMGPROXY_ALLOW_ORIGIN list and return it if there is a match?

from imgproxy.

DarthSim avatar DarthSim commented on May 13, 2024

@thibauds That's exactly what I'm talking about here:

Usually, applications respond with dynamic Access-Control-Allow-Origin that depends on the request origin. But in the case of imgproxy where you put a CDN or a caching server in front, this won't work properly.

from imgproxy.

Related Issues (20)

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.