|
|
@ -168,6 +168,7 @@ export class AttachmentsController { |
|
|
|
|
|
|
|
|
|
|
|
let queryResponseContentType = null; |
|
|
|
let queryResponseContentType = null; |
|
|
|
let queryResponseContentDisposition = null; |
|
|
|
let queryResponseContentDisposition = null; |
|
|
|
|
|
|
|
let queryResponseContentEncoding = null; |
|
|
|
|
|
|
|
|
|
|
|
if (queryHelper.length > 1) { |
|
|
|
if (queryHelper.length > 1) { |
|
|
|
const query = new URLSearchParams(queryHelper[1]); |
|
|
|
const query = new URLSearchParams(queryHelper[1]); |
|
|
@ -175,6 +176,7 @@ export class AttachmentsController { |
|
|
|
queryResponseContentDisposition = query.get( |
|
|
|
queryResponseContentDisposition = query.get( |
|
|
|
'ResponseContentDisposition', |
|
|
|
'ResponseContentDisposition', |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
queryResponseContentEncoding = query.get('ResponseContentEncoding'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const targetParam = param.split('/')[2]; |
|
|
|
const targetParam = param.split('/')[2]; |
|
|
@ -191,12 +193,23 @@ export class AttachmentsController { |
|
|
|
|
|
|
|
|
|
|
|
if (queryResponseContentType) { |
|
|
|
if (queryResponseContentType) { |
|
|
|
res.setHeader('Content-Type', queryResponseContentType); |
|
|
|
res.setHeader('Content-Type', queryResponseContentType); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (queryResponseContentEncoding) { |
|
|
|
|
|
|
|
res.setHeader( |
|
|
|
|
|
|
|
'Content-Type', |
|
|
|
|
|
|
|
`${queryResponseContentType}; charset=${queryResponseContentEncoding}`, |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (queryResponseContentDisposition) { |
|
|
|
if (queryResponseContentDisposition) { |
|
|
|
res.setHeader('Content-Disposition', queryResponseContentDisposition); |
|
|
|
res.setHeader('Content-Disposition', queryResponseContentDisposition); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (queryResponseContentEncoding) { |
|
|
|
|
|
|
|
res.setHeader('Content-Encoding', queryResponseContentEncoding); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
res.sendFile(file.path); |
|
|
|
res.sendFile(file.path); |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
res.status(404).send('Not found'); |
|
|
|
res.status(404).send('Not found'); |
|
|
|