1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-06-08 18:20:20 +00:00

fix(webjob): add dummy file when execution tasks flag is enabled

SAS Track CS0409737
This commit is contained in:
mulahasanovic
2026-05-12 10:11:59 +02:00
parent 55db8f45ab
commit 8be0fd94ad
+21 -1
View File
@@ -18,7 +18,8 @@ import {
parseSasViyaDebugResponse,
appendExtraResponseAttributes,
parseWeboutResponse,
getFormData
getFormData,
isNode
} from '../utils'
import { BaseJobExecutor } from './JobExecutor'
@@ -113,6 +114,25 @@ export class WebJobExecutor extends BaseJobExecutor {
*/
let formData = getFormData()
// FIXME(viya - SAS Track CS0409737): remove when Viya stops rejecting empty multipart on
// _executionTasks=true. Dummy file keeps the body non-empty
const hasExecutionTasksFlag =
sasJob.includes('_executionTasks=true') || config.runAsTask === true
if (config.serverType === ServerType.SasViya && hasExecutionTasksFlag) {
if (isNode()) {
;(formData as NodeFormData).append('_sasjs_noop', '', {
filename: '_sasjs_noop.txt',
contentType: 'text/plain'
})
} else {
;(formData as FormData).append(
'_sasjs_noop',
new Blob([''], { type: 'text/plain' }),
'_sasjs_noop.txt'
)
}
}
if (data) {
const stringifiedData = JSON.stringify(data)
if (