mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-16 16:40:06 +00:00
fix: update code for extracting json url when debug is enabled
This commit is contained in:
@@ -16,10 +16,15 @@ export const parseSasViyaDebugResponse = async (
|
|||||||
requestClient: RequestClient,
|
requestClient: RequestClient,
|
||||||
serverUrl: string
|
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(
|
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]
|
)[1]
|
||||||
const jsonUrl = iframeStart ? iframeStart.split('"></iframe>')[0] : null
|
const jsonUrl = iframeStart
|
||||||
|
? iframeStart.split(/"><\/iframe>|><\/iframe>/)[0]
|
||||||
|
: null
|
||||||
if (!jsonUrl) {
|
if (!jsonUrl) {
|
||||||
throw new Error('Unable to find webout file URL.')
|
throw new Error('Unable to find webout file URL.')
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user