diff --git a/api/src/controllers/internal/Execution.ts b/api/src/controllers/internal/Execution.ts index b7df0ab..fbe3b24 100644 --- a/api/src/controllers/internal/Execution.ts +++ b/api/src/controllers/internal/Execution.ts @@ -78,6 +78,11 @@ export class ExecutionController { const logPath = path.join(session.path, 'log.log') const headersPath = path.join(session.path, 'stpsrv_header.txt') + + if (isDebugOn(vars)) { + await createFile(headersPath, 'content-type: text/plain') + } + const weboutPath = path.join(session.path, 'webout.txt') const tokenFile = path.join(session.path, 'reqHeaders.txt') diff --git a/api/src/controllers/internal/Session.ts b/api/src/controllers/internal/Session.ts index 493952e..ccc08c6 100644 --- a/api/src/controllers/internal/Session.ts +++ b/api/src/controllers/internal/Session.ts @@ -50,7 +50,7 @@ export class SessionController { } const headersPath = path.join(session.path, 'stpsrv_header.txt') - await createFile(headersPath, 'Content-type: text/plain') + await createFile(headersPath, 'content-type: text/html; charset=utf-8') this.sessions.push(session) return session @@ -94,7 +94,7 @@ export class SASSessionController extends SessionController { } const headersPath = path.join(session.path, 'stpsrv_header.txt') - await createFile(headersPath, 'Content-type: text/plain') + await createFile(headersPath, 'content-type: text/html; charset=utf-8') // we do not want to leave sessions running forever // we clean them up after a predefined period, if unused diff --git a/api/src/controllers/stp.ts b/api/src/controllers/stp.ts index 86120ec..b103688 100644 --- a/api/src/controllers/stp.ts +++ b/api/src/controllers/stp.ts @@ -91,6 +91,8 @@ const execute = async ( } ) + req.res?.header(httpHeaders) + if (result instanceof Buffer) { ;(req as any).sasHeaders = httpHeaders }