xo: Reenable several easy rules.

Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
Anders Kaseorg
2020-03-04 20:06:20 -08:00
parent d0f8c040c7
commit ca5de73155
8 changed files with 16 additions and 30 deletions

View File

@@ -1,7 +1,5 @@
'use strict';
import url from 'url';
import * as ConfigUtil from './config-util';
export interface ProxyRule {
@@ -11,12 +9,13 @@ export interface ProxyRule {
// Return proxy to be used for a particular uri, to be used for request
export function getProxy(_uri: string): ProxyRule | void {
const parsedUri = url.parse(_uri);
if (parsedUri === null) {
let uri;
try {
uri = new URL(_uri);
} catch (err) {
return;
}
const uri = parsedUri;
const proxyRules = ConfigUtil.getConfigItem('proxyRules', '').split(';');
// If SPS is on and system uses no proxy then request should not try to use proxy from
// environment. NO_PROXY = '*' makes request ignore all environment proxy variables.