Skip to content

Commit

Permalink
attach auth headers for reject requests
Browse files Browse the repository at this point in the history
  • Loading branch information
IbrahimCSAE committed Dec 20, 2024
1 parent 921e8f9 commit 0c5222c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion extensions/default/src/DicomWebDataSource/dcm4cheeReject.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default function (wadoRoot) {
export default function (wadoRoot, getAuthrorizationHeader) {
return {
series: (StudyInstanceUID, SeriesInstanceUID) => {
return new Promise((resolve, reject) => {
Expand All @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion extensions/default/src/DicomWebDataSource/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0c5222c

Please sign in to comment.