mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-09 13:30:04 +00:00
fix(location): added handle cases when 'location' is not defined
This commit is contained in:
12
src/SASjs.ts
12
src/SASjs.ts
@@ -1365,11 +1365,15 @@ export default class SASjs {
|
|||||||
this.sasjsConfig.serverUrl === undefined ||
|
this.sasjsConfig.serverUrl === undefined ||
|
||||||
this.sasjsConfig.serverUrl === ''
|
this.sasjsConfig.serverUrl === ''
|
||||||
) {
|
) {
|
||||||
let url = `${location.protocol}//${location.hostname}`
|
if (typeof location !== 'undefined') {
|
||||||
if (location.port) {
|
let url = `${location.protocol}//${location.hostname}`
|
||||||
url = `${url}:${location.port}`
|
|
||||||
|
if (location.port) url = `${url}:${location.port}`
|
||||||
|
|
||||||
|
this.sasjsConfig.serverUrl = url
|
||||||
|
} else {
|
||||||
|
this.sasjsConfig.serverUrl = ''
|
||||||
}
|
}
|
||||||
this.sasjsConfig.serverUrl = url
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.sasjsConfig.serverUrl.slice(-1) === '/') {
|
if (this.sasjsConfig.serverUrl.slice(-1) === '/') {
|
||||||
|
|||||||
Reference in New Issue
Block a user