From 2d733acbe3e310173b64d7faac9c0c42d29e9aae Mon Sep 17 00:00:00 2001 From: Federico Marolla Date: Mon, 13 Jan 2025 14:22:48 +0100 Subject: [PATCH] fix file format --- src/createDicomWebTreeApi.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/createDicomWebTreeApi.ts b/src/createDicomWebTreeApi.ts index df2214f..c3d6106 100644 --- a/src/createDicomWebTreeApi.ts +++ b/src/createDicomWebTreeApi.ts @@ -72,7 +72,10 @@ const initializeHealthlakeFetch = (healthlake) => { xhr.open('POST', uri, true); xhr.wasGetResponseHeader = xhr.getResponseHeader; xhr.getResponseHeader = function (key: string) { - if (key == 'Content-Type') return 'image/jphc'; + if (key == 'Content-Type') { + let value = this.wasGetResponseHeader(key); + return value == "image/j2c" ? 'image/jp2' : "image/jphc"; + } return this.wasGetResponseHeader(key); };