mirror of
https://github.com/sasjs/server.git
synced 2025-12-11 19:44:35 +00:00
fix: pass _program to execute file without extension
This commit is contained in:
@@ -131,15 +131,11 @@ const executeReturnRaw = async (
|
|||||||
_program: string
|
_program: string
|
||||||
): Promise<string | Buffer> => {
|
): Promise<string | Buffer> => {
|
||||||
const query = req.query as ExecutionVars
|
const query = req.query as ExecutionVars
|
||||||
const sasCodePath =
|
|
||||||
path
|
|
||||||
.join(getFilesFolder(), _program)
|
|
||||||
.replace(new RegExp('/', 'g'), path.sep) + '.sas'
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { result, httpHeaders } =
|
const { result, httpHeaders } =
|
||||||
(await new ExecutionController().executeFile(
|
(await new ExecutionController().executeFile(
|
||||||
sasCodePath,
|
_program,
|
||||||
getPreProgramVariables(req),
|
getPreProgramVariables(req),
|
||||||
query
|
query
|
||||||
)) as ExecuteReturnRaw
|
)) as ExecuteReturnRaw
|
||||||
@@ -171,11 +167,6 @@ const executeReturnJson = async (
|
|||||||
req: express.Request,
|
req: express.Request,
|
||||||
_program: string
|
_program: string
|
||||||
): Promise<ExecuteReturnJsonResponse> => {
|
): Promise<ExecuteReturnJsonResponse> => {
|
||||||
const sasCodePath =
|
|
||||||
path
|
|
||||||
.join(getFilesFolder(), _program)
|
|
||||||
.replace(new RegExp('/', 'g'), path.sep) + '.sas'
|
|
||||||
|
|
||||||
const filesNamesMap = req.files?.length
|
const filesNamesMap = req.files?.length
|
||||||
? makeFilesNamesMap(req.files as MulterFile[])
|
? makeFilesNamesMap(req.files as MulterFile[])
|
||||||
: null
|
: null
|
||||||
@@ -183,12 +174,12 @@ const executeReturnJson = async (
|
|||||||
try {
|
try {
|
||||||
const { webout, log, httpHeaders } =
|
const { webout, log, httpHeaders } =
|
||||||
(await new ExecutionController().executeFile(
|
(await new ExecutionController().executeFile(
|
||||||
sasCodePath,
|
_program,
|
||||||
getPreProgramVariables(req),
|
getPreProgramVariables(req),
|
||||||
{ ...req.query, ...req.body },
|
{ ...req.query, ...req.body },
|
||||||
{ filesNamesMap: filesNamesMap },
|
{ filesNamesMap: filesNamesMap },
|
||||||
true,
|
true,
|
||||||
req.sasSession
|
req.sasjsSession
|
||||||
)) as ExecuteReturnJson
|
)) as ExecuteReturnJson
|
||||||
|
|
||||||
let weboutRes: string | IRecordOfAny = webout
|
let weboutRes: string | IRecordOfAny = webout
|
||||||
|
|||||||
Reference in New Issue
Block a user