1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-04 21:30:05 +00:00

fix: added cookie for accessToken

This commit is contained in:
Saad Jutt
2022-03-09 05:06:06 +05:00
parent 0f4e38d51d
commit 698180ab7e
6 changed files with 72 additions and 4 deletions

View File

@@ -194,7 +194,12 @@ const getFile = async (req: express.Request, filePath: string) => {
throw new Error('File does not exist.')
}
req.res?.download(filePathFull)
const extension = path.extname(filePathFull).toLowerCase()
if (extension === '.sas') {
req.res?.setHeader('Content-type', 'text/plain')
}
req.res?.sendFile(path.resolve(filePathFull))
}
const saveFile = async (