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

feat: set response headers provded by SAS Code execution

This commit is contained in:
Saad Jutt
2022-02-18 07:22:11 +05:00
parent cd32912379
commit 2c4aa420b3
10 changed files with 154 additions and 25 deletions

View File

@@ -1,6 +1,6 @@
import express from 'express'
import { Request, Security, Route, Tags, Post, Body } from 'tsoa'
import { ExecutionController } from './internal'
import { ExecuteReturnRaw, ExecutionController } from './internal'
import { PreProgramVars } from '../types'
interface ExecuteSASCodePayload {
@@ -30,13 +30,13 @@ export class CodeController {
const executeSASCode = async (req: any, { code }: ExecuteSASCodePayload) => {
try {
const result = await new ExecutionController().executeProgram(
const { result } = (await new ExecutionController().executeProgram(
code,
getPreProgramVariables(req),
{ ...req.query, _debug: 131 },
undefined,
true
)
)) as ExecuteReturnRaw
return result as string
} catch (err: any) {