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

BREAKING CHANGE: boolean allowInsecure is replaced configuration of Https Agent

This commit is contained in:
Saad Jutt
2021-09-28 16:02:12 +05:00
parent f964bcef9e
commit f0ecfa57e5
8 changed files with 57 additions and 26 deletions

View File

@@ -3,14 +3,15 @@ import axiosCookieJarSupport from 'axios-cookiejar-support'
import * as tough from 'tough-cookie'
import { prefixMessage } from '@sasjs/utils/error'
import { RequestClient, throwIfError } from './RequestClient'
import { HttpsAgent } from '../types/HttpsAgent'
/**
* Specific request client for SAS9 in Node.js environments.
* Handles redirects and cookie management.
*/
export class Sas9RequestClient extends RequestClient {
constructor(baseUrl: string, allowInsecure = false) {
super(baseUrl, allowInsecure)
constructor(baseUrl: string, httpsAgentConfiguration?: HttpsAgent) {
super(baseUrl, httpsAgentConfiguration)
this.httpClient.defaults.maxRedirects = 0
this.httpClient.defaults.validateStatus = (status) =>
status >= 200 && status < 303