-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
microservices cross-origin headers #432
Comments
Don't see anything mentioned on https://github.com/search?q=repo%3Aglencoesoftware%2Fomero-ms-image-region%20cors&type=code I imagine something like:
would be necessary (as a configurable option). See https://stackoverflow.com/a/52420183/56887 |
Note that as per #176, the responsibility of setting the CORS headers has been shifted to the NGINX layer rather than the OMERO.web Django framework. That should be relevant to the micro-service since the same configuration is handling the routing of the relevant From the above |
Hmmm - OK, thanks for that. I've been working on a summer side project to start a mobile-friendly web app for OMERO, initially using a static hosted site loading IDR data via public JSON and image urls... Have a look at https://omero-skye.netlify.app/ Now, when I try to load images with This is looking at If right-click on the broken image and open the image in a new Tab, e.g. https://idr.openmicroscopy.org/webclient/render_image/9837232/82/0/ then I see that the micro-services rejects this with Anyway, I added the query-string to the
I don't know what causes the difference in these 2 behaviours - maybe I'm just hitting different readonly servers at different times. Anyway, this seems to be not quite a CORS issue on the client, but a server-side issue that is returning a 403 response from a cross-origin request, but once the response has been cached on the server then the same render_image URL will work cross-origin. If you change the rendering settings or Z/T then you get a 403 response again. It's also possible to replicate this in any html page, e.g https://jsbin.com/ if you enter You get a 403 response. |
Yes, I think this is related to ome/omero-web#440 and a series of issues raised by work on the rendering endpoints in the micro-service and discussed at the weekly OMERO.web meetings. The micro-service is more strict on some query parameters e.g. channels are required but OMERO.web was not modified.
That's highly unlikely unless your IP is changing in between your calls
I also suspect this is not an CORS issue. Instead I think is related to the logic to retrieve the OMERO session key from the OMERO.web cookie in https://github.com/glencoesoftware/omero-ms-core/blob/14b01cd7c4c4d27cf9cb065236a52b6314dc4835/src/main/java/com/glencoesoftware/omero/ms/core/OmeroWebSessionRequestHandler.java#L76-L119. |
IDR includes CORS headers in all standard responses, allowing sites at other origins to consume JSON, Images etc.
However, it seems that this is not the case with micro-services, so that when I try to view a rendered image from a page at another origin, this is now fails:
E.g. when working on idr-gallery locally, it is configured to load images from IDR. This still works for thumbnails but not full images:
cc @khaledk2
The text was updated successfully, but these errors were encountered: