fix bugs related no_proxy and ports: 1) https://foo.com should match no_proxy=foo.com:443 and 2) https://foo.com:8080 should match no_proxy=foo.com
This commit is contained in:
10
index.ts
10
index.ts
@@ -35,13 +35,21 @@ export enum HttpCodes {
|
||||
GatewayTimeout = 504,
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
|
||||
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||
*/
|
||||
export function getProxyUrl(serverUrl: string): string {
|
||||
let proxyUrl = pm.getProxyUrl(url.parse(serverUrl))
|
||||
return proxyUrl ? proxyUrl.href : ''
|
||||
}
|
||||
|
||||
const HttpRedirectCodes: number[] = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
|
||||
const HttpResponseRetryCodes: number[] = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
|
||||
const RetryableHttpVerbs: string[] = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
|
||||
const ExponentialBackoffCeiling = 10;
|
||||
const ExponentialBackoffTimeSlice = 5;
|
||||
|
||||
|
||||
export class HttpClientResponse implements ifm.IHttpClientResponse {
|
||||
constructor(message: http.IncomingMessage) {
|
||||
this.message = message;
|
||||
|
||||
Reference in New Issue
Block a user