From 9977c9d161947b11d45ab2513f99a5320a3f5a06 Mon Sep 17 00:00:00 2001 From: Sabir Hassan Date: Tue, 20 Sep 2022 02:32:22 +0500 Subject: [PATCH] fix: default content-type for sas programs should be text/plain --- api/src/controllers/internal/Session.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api/src/controllers/internal/Session.ts b/api/src/controllers/internal/Session.ts index 56e7df8..3e61e34 100644 --- a/api/src/controllers/internal/Session.ts +++ b/api/src/controllers/internal/Session.ts @@ -92,6 +92,9 @@ export class SASSessionController extends SessionController { path: sessionFolder } + const headersPath = path.join(session.path, 'stpsrv_header.txt') + await createFile(headersPath, 'Content-type: text/plain') + // we do not want to leave sessions running forever // we clean them up after a predefined period, if unused this.scheduleSessionDestroy(session) @@ -170,7 +173,7 @@ ${autoExecContent}` session.ready = true } - public async deleteSession(session: Session) { + private async deleteSession(session: Session) { // remove the temporary files, to avoid buildup await deleteFolder(session.path)