1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-14 07:30:05 +00:00

fix: comments and logic tidy up

This commit is contained in:
Allan Bowe
2022-02-22 08:38:25 +00:00
parent d9cb2db61f
commit 487cb489f3
3 changed files with 33 additions and 6 deletions

View File

@@ -109,6 +109,10 @@ export class WebJobExecutor extends BaseJobExecutor {
...this.getRequestParams(config)
}
/**
* Use the available form data object (FormData in Browser, NodeFormData in
* Node)
*/
let formData =
typeof FormData === 'undefined' ? new NodeFormData() : new FormData()
@@ -145,6 +149,7 @@ export class WebJobExecutor extends BaseJobExecutor {
}
}
/* The NodeFormData object does not set the request header - so, set it */
const contentType =
formData instanceof NodeFormData
? `multipart/form-data; boundary=${formData.getBoundary()}`