Strip DIRECT in the migration of a proxy string

This commit is contained in:
Ilya Ig. Petrov 2017-06-12 22:15:15 +05:00
parent 72b4802a45
commit b42b6a03d4

View File

@ -505,6 +505,7 @@ PROXY foobar.com:8080; # Not HTTP!`.trim()}
return proxyStringRaw return proxyStringRaw
.replace(/#.*$/mg, '') // Strip comments. .replace(/#.*$/mg, '') // Strip comments.
.replace(/\s*DIRECT\s*/g, '') // Remove DIRECT from old versions.
.split( /(?:[^\S\r\n]*(?:;|\r?\n)+[^\S\r\n]*)+/g ) .split( /(?:[^\S\r\n]*(?:;|\r?\n)+[^\S\r\n]*)+/g )
.map( (p) => p.trim() ) .map( (p) => p.trim() )
.filter((p) => p) .filter((p) => p)