From 0749d65173e8cfe9a93464711b7be1e123c289ff Mon Sep 17 00:00:00 2001 From: Sabir Hassan Date: Mon, 19 Sep 2022 15:53:51 +0500 Subject: [PATCH] fix: SASJS_WEBOUT_HEADERS path for windows --- api/src/controllers/internal/createJSProgram.ts | 4 +++- api/src/controllers/internal/createPythonProgram.ts | 4 +++- api/src/controllers/internal/createRProgram.ts | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/api/src/controllers/internal/createJSProgram.ts b/api/src/controllers/internal/createJSProgram.ts index 2a7d594..dcea6b8 100644 --- a/api/src/controllers/internal/createJSProgram.ts +++ b/api/src/controllers/internal/createJSProgram.ts @@ -27,7 +27,9 @@ const weboutPath = '${ const _SASJS_TOKENFILE = '${ isWindows() ? tokenFile.replace(/\\/g, '\\\\') : tokenFile }'; -const _SASJS_WEBOUT_HEADERS = '${headersPath}'; +const _SASJS_WEBOUT_HEADERS = '${ + isWindows() ? headersPath.replace(/\\/g, '\\\\') : headersPath + }'; const _SASJS_USERNAME = '${preProgramVariables?.username}'; const _SASJS_USERID = '${preProgramVariables?.userId}'; const _SASJS_DISPLAYNAME = '${preProgramVariables?.displayName}'; diff --git a/api/src/controllers/internal/createPythonProgram.ts b/api/src/controllers/internal/createPythonProgram.ts index d33231c..f71f5d5 100644 --- a/api/src/controllers/internal/createPythonProgram.ts +++ b/api/src/controllers/internal/createPythonProgram.ts @@ -23,7 +23,9 @@ _SASJS_SESSION_PATH = '${ isWindows() ? session.path.replace(/\\/g, '\\\\') : session.path }'; _WEBOUT = '${isWindows() ? weboutPath.replace(/\\/g, '\\\\') : weboutPath}'; -_SASJS_WEBOUT_HEADERS = '${headersPath}'; +_SASJS_WEBOUT_HEADERS = '${ + isWindows() ? headersPath.replace(/\\/g, '\\\\') : headersPath + }'; _SASJS_TOKENFILE = '${ isWindows() ? tokenFile.replace(/\\/g, '\\\\') : tokenFile }'; diff --git a/api/src/controllers/internal/createRProgram.ts b/api/src/controllers/internal/createRProgram.ts index 33af81c..e7b4a80 100644 --- a/api/src/controllers/internal/createRProgram.ts +++ b/api/src/controllers/internal/createRProgram.ts @@ -23,7 +23,9 @@ export const createRProgram = async ( isWindows() ? session.path.replace(/\\/g, '\\\\') : session.path }'; ._WEBOUT <- '${isWindows() ? weboutPath.replace(/\\/g, '\\\\') : weboutPath}'; -._SASJS_WEBOUT_HEADERS <- '${headersPath}'; +._SASJS_WEBOUT_HEADERS <- '${ + isWindows() ? headersPath.replace(/\\/g, '\\\\') : headersPath + }'; ._SASJS_TOKENFILE <- '${ isWindows() ? tokenFile.replace(/\\/g, '\\\\') : tokenFile }';