Skip to content

Commit 0925b47

Browse files
try build url with host
1 parent 267eec0 commit 0925b47

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

sandbox/src/routes/r4/retrieveAttachment.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ module.exports = [
1818
}
1919

2020
const binaryId = request.params.binaryId;
21-
const url = request.url.href;
2221
const objectStore = "/ObjectStore/d497bbe3-f88b-45f1-b3d4-9c563e4c0f5f";
23-
const location = url.split('/FHIR')[0] + objectStore;
22+
const location = request.server.info.protocol + "://" + request.headers['host'] + objectStore;
2423

2524
if ((validationUtil.hasLegacyPrefix(binaryId) || validationUtil.isValidUuid(binaryId)) && request.method === 'get') {
2625
const response = h.response().code(307);

0 commit comments

Comments
 (0)