fix: Use correct external URL for rendered responses with relative URI (#4236)

This commit is contained in:
Bill Wallace authored and GitHub committed 2024-06-17 22:36:03 -04:00
1 parent 6fc4390645
commit d8f6991dbe
9 files changed
+182 -24

No files matched your search

@@ -17,7 +17,12 @@ const createRenderedRetrieve = (config, params) => {
const { wadoRoot } = config;
const { instance, tag = 'PixelData' } = params;
const { StudyInstanceUID, SeriesInstanceUID, SOPInstanceUID } = instance;
const value = instance[tag];
if (value?.BulkDataURI?.indexOf('?') !== -1) {
// The value instance has parameters, so it should not revert to the rendered
return;
}
if (tag === 'PixelData' || tag === 'EncapsulatedDocument') {
return `${wadoRoot}/studies/${StudyInstanceUID}/series/${SeriesInstanceUID}/instances/${SOPInstanceUID}/rendered`;
}
@@ -22,7 +22,7 @@ const getBulkdataValue = (config, params) => {
const value = instance[tag];
const { SeriesInstanceUID, SOPInstanceUID } = instance;
const { StudyInstanceUID, SeriesInstanceUID, SOPInstanceUID } = instance;
const BulkDataURI =
(value && value.BulkDataURI) ||
@@ -32,6 +32,11 @@ const getBulkdataValue = (config, params) => {
const acceptUri =
BulkDataURI + (hasAccept ? '' : (hasQuery ? '&' : '?') + `accept=${defaultType}`);
if (acceptUri.startsWith('series/')) {
const { wadoRoot } = config;
return `${wadoRoot}/studies/${StudyInstanceUID}/${acceptUri}`;
}
// The DICOMweb standard states that the default is multipart related, and then
// separately states that the accept parameter is the URL parameter equivalent of the accept header.
return acceptUri;