Skip to content

Commit

Permalink
fix: WADO-RS' imageFullPath incorrect
Browse files Browse the repository at this point in the history
# Problem
- `imageFullPath` need to append slash in `DICOM_STORE_ROOTPATH` env
- If not appned, it will get `rootfiles/item`,
but correct is `root/files/item`

# Solution
- Use `path.join` instead of string concat
  • Loading branch information
Chinlinlee committed Mar 8, 2023
1 parent 8a5cf54 commit 5b2c163
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/multipartWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ class MultipartWriter {
if (this.pathsOfImages) {
this.setHeaderMultipartRelatedContentType(type);
for (let i = 0; i < this.pathsOfImages.length; i++) {
console.log(`${DICOM_STORE_ROOTPATH}${this.pathsOfImages[i]}`);
let fileBuffer = await streamToBuffer(fs.createReadStream(`${DICOM_STORE_ROOTPATH}${this.pathsOfImages[i]}`));
let imageFullPath = path.join(DICOM_STORE_ROOTPATH, this.pathsOfImages[i]);
let fileBuffer = await streamToBuffer(fs.createReadStream(imageFullPath));
this.writeBoundary(i === 0);
this.writeContentType(type);
this.writeContentLength(fileBuffer.length);
Expand Down

0 comments on commit 5b2c163

Please sign in to comment.