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

fix: code fixes for executing program from program path including file extension

This commit is contained in:
2022-06-15 16:18:07 +05:00
parent 81501d17ab
commit 53854d0012
4 changed files with 45 additions and 14 deletions

View File

@@ -131,9 +131,9 @@ const executeReturnRaw = async (
): Promise<string | Buffer> => {
const query = req.query as ExecutionVars
const { codePath, runTime } = await getRunTimeAndFilePath(_program)
try {
const { codePath, runTime } = await getRunTimeAndFilePath(_program)
const { result, httpHeaders } =
(await new ExecutionController().executeFile({
programPath: codePath,
@@ -169,13 +169,13 @@ const executeReturnJson = async (
req: express.Request,
_program: string
): Promise<ExecuteReturnJsonResponse> => {
const { codePath, runTime } = await getRunTimeAndFilePath(_program)
const filesNamesMap = req.files?.length
? makeFilesNamesMap(req.files as MulterFile[])
: null
try {
const { codePath, runTime } = await getRunTimeAndFilePath(_program)
const { webout, log, httpHeaders } =
(await new ExecutionController().executeFile({
programPath: codePath,