From 0c5222cdb80b48ef5df65da7bde8221d4f149463 Mon Sep 17 00:00:00 2001 From: Ibrahim Date: Fri, 20 Dec 2024 05:21:31 -0500 Subject: [PATCH 1/2] attach auth headers for reject requests --- .../default/src/DicomWebDataSource/dcm4cheeReject.js | 8 +++++++- extensions/default/src/DicomWebDataSource/index.ts | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/extensions/default/src/DicomWebDataSource/dcm4cheeReject.js b/extensions/default/src/DicomWebDataSource/dcm4cheeReject.js index 542267abefb..979a682523f 100644 --- a/extensions/default/src/DicomWebDataSource/dcm4cheeReject.js +++ b/extensions/default/src/DicomWebDataSource/dcm4cheeReject.js @@ -1,4 +1,4 @@ -export default function (wadoRoot) { +export default function (wadoRoot, getAuthrorizationHeader) { return { series: (StudyInstanceUID, SeriesInstanceUID) => { return new Promise((resolve, reject) => { @@ -10,6 +10,12 @@ export default function (wadoRoot) { const xhr = new XMLHttpRequest(); xhr.open('POST', url, true); + const headers = getAuthrorizationHeader(); + + for (const key in headers) { + xhr.setRequestHeader(key, headers[key]); + } + //Send the proper header information along with the request // TODO -> Auth when we re-add authorization. diff --git a/extensions/default/src/DicomWebDataSource/index.ts b/extensions/default/src/DicomWebDataSource/index.ts index 6a915c0c351..3dab36a3e98 100644 --- a/extensions/default/src/DicomWebDataSource/index.ts +++ b/extensions/default/src/DicomWebDataSource/index.ts @@ -598,7 +598,7 @@ function createDicomWebApi(dicomWebConfig: DicomWebConfig, servicesManager) { }; if (dicomWebConfig.supportsReject) { - implementation.reject = dcm4cheeReject(dicomWebConfig.wadoRoot); + implementation.reject = dcm4cheeReject(dicomWebConfig.wadoRoot, getAuthrorizationHeader); } return IWebApiDataSource.create(implementation); From 5fda5bdf51e37839b643655dd48abc5533453f92 Mon Sep 17 00:00:00 2001 From: Ibrahim Date: Fri, 20 Dec 2024 10:17:00 -0500 Subject: [PATCH 2/2] spelling --- extensions/default/src/DicomWebDataSource/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/default/src/DicomWebDataSource/index.ts b/extensions/default/src/DicomWebDataSource/index.ts index 3dab36a3e98..6bf6c4e12d3 100644 --- a/extensions/default/src/DicomWebDataSource/index.ts +++ b/extensions/default/src/DicomWebDataSource/index.ts @@ -598,7 +598,7 @@ function createDicomWebApi(dicomWebConfig: DicomWebConfig, servicesManager) { }; if (dicomWebConfig.supportsReject) { - implementation.reject = dcm4cheeReject(dicomWebConfig.wadoRoot, getAuthrorizationHeader); + implementation.reject = dcm4cheeReject(dicomWebConfig.wadoRoot, getAuthorizationHeader); } return IWebApiDataSource.create(implementation);