mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-03 10:40:06 +00:00
Merge branch 'master' into dependabot/npm_and_yarn/types/jest-26.0.10
This commit is contained in:
@@ -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`.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
13
src/SASjs.ts
13
src/SASjs.ts
@@ -2,7 +2,9 @@ import { isIEorEdgeOrOldFirefox } from "./utils/isIeOrEdge";
|
||||
import * as e6p from "es6-promise";
|
||||
(e6p as any).polyfill();
|
||||
if (isIEorEdgeOrOldFirefox()) {
|
||||
window.fetch = undefined as any; // ensure the polyfill runs
|
||||
if (window) {
|
||||
window.fetch = undefined as any; // ensure the polyfill runs
|
||||
}
|
||||
}
|
||||
// tslint:disable-next-line
|
||||
require("isomorphic-fetch");
|
||||
@@ -397,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);
|
||||
}
|
||||
|
||||
@@ -909,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;
|
||||
@@ -1175,7 +1183,8 @@ export default class SASjs {
|
||||
this.fileUploader = new FileUploader(
|
||||
this.sasjsConfig.appLoc,
|
||||
this.sasjsConfig.serverUrl,
|
||||
this.jobsPath
|
||||
this.jobsPath,
|
||||
this.setCsrfTokenWeb
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
export function isIEorEdgeOrOldFirefox() {
|
||||
if (typeof window === "undefined") {
|
||||
return false;
|
||||
}
|
||||
const ua = window.navigator.userAgent;
|
||||
|
||||
if (ua.indexOf("Firefox") > 0) {
|
||||
|
||||
Reference in New Issue
Block a user