1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-10 11:24:35 +00:00

Merge pull request #324 from sasjs/issue-322

fix: update the response header of request to stp/execute routes
This commit is contained in:
Allan Bowe
2022-11-28 17:38:05 +00:00
committed by GitHub
3 changed files with 9 additions and 2 deletions

View File

@@ -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')

View File

@@ -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

View File

@@ -91,6 +91,8 @@ const execute = async (
}
)
req.res?.header(httpHeaders)
if (result instanceof Buffer) {
;(req as any).sasHeaders = httpHeaders
}