CORS Policy Error When Accessing DICOM Images in OHIF Viewer Embedded

31 views
Skip to first unread message

Anas Mehmood

unread,
Nov 29, 2023, 8:31:10 AM11/29/23
to cornerstone platform
I am encountering an issue with my Laravel application, where I have embedded the OHIF viewer using an iframe. The error I am facing is as follows:
Access to XMLHttpRequest at 'http://127.0.0.1:8000/pacs/LIDC-IDRI-0001/01-01-2000-30178/3000566.000000-03192/1-001.dcm' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I believe this issue is related to the Cross-Origin Resource Sharing (CORS) policy. Specifically, it seems that the required 'Access-Control-Allow-Origin' header is missing in the response to the preflight request.

I would appreciate any insights or guidance on how to address this CORS policy error in the context of embedding the OHIF viewer in a Laravel application and sending the path for DICOM images.

Ricardo Borjas

unread,
Nov 29, 2023, 8:54:12 AM11/29/23
to Anas Mehmood, cornerstone platform
Try enabling HTTPS instead of plain HTTP.
Besides, 127.0.0.1 and localhost are treated as different domains and some rules apply. 
Try to use the same address or domain name, even if they are on the same physical server. 
Both your PACS server and your OHIF server must share the same protocol.

--
You received this message because you are subscribed to the Google Groups "cornerstone platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cornerstone-plat...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cornerstone-platform/bbbca675-9011-4278-87c2-9957caff5c77n%40googlegroups.com.


--
Ricardo Borjas
IT & Software Development Consultant
ricardo....@gmail.com
Reply all
Reply to author
Forward
0 new messages