Git Product home page Git Product logo

Comments (6)

Ethoxyethaan avatar Ethoxyethaan commented on August 12, 2024

Set
image.crossOrigin = 'anonymous';
to
image.crossOrigin = 'use-credentials';

in cornerstoneWebImageLoader.js

from cornerstonewebimageloader.

chafey avatar chafey commented on August 12, 2024

I just modified cornerstoneWebImageLoader to use XHR to load images and included a mechanism to configure a beforeSend callback so you can modify XHR as needed (e.g. to add auth headers). See the example on how to use this.

Please close this issue if it meets your needs

from cornerstonewebimageloader.

Ethoxyethaan avatar Ethoxyethaan commented on August 12, 2024

Chafey

I think the Image() constructor does not respect the Same-origin policy however xmlhttprequest does. (unless server permits it ... with the needed configuration changes.)

Am i allowed to suggest a duo solution, or am i missing out on some information?

from cornerstonewebimageloader.

chafey avatar chafey commented on August 12, 2024

You are free to suggest anything! Are you saying that you need the less secure CORS bypassing feature of Image()?

from cornerstonewebimageloader.

Ethoxyethaan avatar Ethoxyethaan commented on August 12, 2024

Personally: no, I use a reverse proxy for the collection of image resources because we want to audit and control everything that happens on top of the vendor provided image archives.

In the past I've seen Image() being used to bypass same-origin policy for viewing server side rendered dicom, I'd figure other people would like to make use of it too.

Anyway perhaps this is outside the scope of this small plugin. I'll suggest a patch that allows the unsafe Image() constructor in parallel with the xmlhttprequest and lets see if people like it or not.

Thanks for your contributions Chafey, I really enjoy your liberary, i feel guilty that my work|life currently doesn't permit me to spend too much time to help out with the tools. I hope to improve this in the future.

from cornerstonewebimageloader.

chafey avatar chafey commented on August 12, 2024

Personally I think the library should default to safe and secure behavior and should not use Image() at all. If someone wants to bypass CORS, they can make their own image loader.

Please don't feel guilty at all - the fact that it is being used and people appreciate it is highly satisfying. I hope you can find time to contribute in the future so you can experience the same satisfaction I do!

from cornerstonewebimageloader.

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.