diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 135d8de..fff2908 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -70,6 +70,14 @@ parmcards4; %webout(CLOSE) ;;;; %mp_createwebservice(path=/Public/app/common,name=sendArr) +filename ft15f001 temp; +parmcards4; +If you can keep your head when all about you + Are losing theirs and blaming it on you, +If you can trust yourself when all men doubt you, + But make allowance for their doubting too; +;;;; +%mp_createwebservice(path=/Public/app/common,name=makeErr) ``` The above services will return anything you send. To run the tests simply launch `npm run cypress`. diff --git a/src/FileUploader.ts b/src/FileUploader.ts index e2ccd7d..b659276 100644 --- a/src/FileUploader.ts +++ b/src/FileUploader.ts @@ -9,7 +9,8 @@ export class FileUploader { private appLoc: string, private serverUrl: string, private jobsPath: string, - private csrfToken: CsrfToken | null = null + private setCsrfTokenWeb: any, + private csrfToken: CsrfToken | null = null, ) {} private retryCount = 0; @@ -61,6 +62,8 @@ export class FileUploader { headerName: tokenHeader, value: token || "", }; + + this.setCsrfTokenWeb(this.csrfToken); } } } diff --git a/src/SASjs.ts b/src/SASjs.ts index c3c909a..480fdc4 100644 --- a/src/SASjs.ts +++ b/src/SASjs.ts @@ -399,8 +399,10 @@ export default class SASjs { this.sasjsConfig.appLoc, this.sasjsConfig.serverUrl, this.jobsPath, + this.setCsrfTokenWeb, this.csrfTokenWeb ); + return fileUploader.uploadFile(sasJob, files, params); } @@ -911,6 +913,10 @@ export default class SASjs { return sasjsWaitingRequest.requestPromise.promise; } + + private setCsrfTokenWeb = (csrfToken: CsrfToken) => { + this.csrfTokenWeb = csrfToken; + }; private setCsrfTokenApi = (csrfToken: CsrfToken) => { this.csrfTokenApi = csrfToken; @@ -1181,7 +1187,8 @@ export default class SASjs { this.fileUploader = new FileUploader( this.sasjsConfig.appLoc, this.sasjsConfig.serverUrl, - this.jobsPath + this.jobsPath, + this.setCsrfTokenWeb ); }