Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
request.on("redirect", (statusCode: number, method: string, redirectUrl: string) => {
// no way to modify request options, abort old and make a new one
// https://github.com/electron/electron/issues/11505
request.abort()
if (redirectCount > this.maxRedirects) {
reject(this.createMaxRedirectError())
}
else {
handler(HttpExecutor.prepareRedirectUrlOptions(redirectUrl, options))
}
})
}