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:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user