Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private async fetchWsdl(opts: ClientOptions): Promise {
if (wsdlIsFile(opts)) {
const wsdlString = fs.readFileSync(opts.wsdlPath, {
encoding: 'utf-8',
})
return await Promise.resolve(wsdlString)
} else {
const creds = opts.credentials
const headers = creds ? this.makeAuthHeader(creds) : {}
const credentials = creds ? 'include' : undefined
const init = { credentials, headers, method: 'GET', mode: 'cors' }
const wsdlString = await (await new Http().get(
opts.wsdlPath,
init
)).text()
return wsdlString
}
}