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

Merge pull request #690 from sasjs/issue-689

fix: update code for extracting JSON URL on viya4 when debug is enabled
This commit is contained in:
Allan Bowe
2022-03-31 15:54:20 +03:00
committed by GitHub

View File

@@ -16,10 +16,15 @@ export const parseSasViyaDebugResponse = async (
requestClient: RequestClient,
serverUrl: string
) => {
// On viya 3.5, iframe is like <iframe style="width: 99%; height: 500px" src="..."></iframe>
// On viya 4, iframe is like <iframe style="width: 99%; height: 500px; background-color:Canvas;" src=...></iframe>
const iframeStart = response.split(
'<iframe style="width: 99%; height: 500px" src="'
/<iframe style="width: 99%; height: 500px" src="|<iframe style="width: 99%; height: 500px; background-color:Canvas;" src=/
)[1]
const jsonUrl = iframeStart ? iframeStart.split('"></iframe>')[0] : null
const jsonUrl = iframeStart
? iframeStart.split(/"><\/iframe>|><\/iframe>/)[0]
: null
if (!jsonUrl) {
throw new Error('Unable to find webout file URL.')
}