From 7cfb73ac97adc3aee4e89725f503774b9bbf0746 Mon Sep 17 00:00:00 2001 From: Juergen Hoetzel Date: Tue, 27 Dec 2016 18:22:00 +0100 Subject: [PATCH] Correctly escape no_proxy domains --- src/Paket.Bootstrapper/EnvProxy.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Paket.Bootstrapper/EnvProxy.cs b/src/Paket.Bootstrapper/EnvProxy.cs index 165fe3e209..acb7f7a307 100644 --- a/src/Paket.Bootstrapper/EnvProxy.cs +++ b/src/Paket.Bootstrapper/EnvProxy.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using System.Net; +using System.Text.RegularExpressions; +using System.Linq; namespace Paket.Bootstrapper { @@ -21,7 +23,8 @@ private string[] GetBypassList() var noproxy = GetEnvVarValue("NO_PROXY"); if (string.IsNullOrEmpty(noproxy)) return new string[0]; - return noproxy.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); + return noproxy.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries) + .Select(s => "^" + Regex.Escape(s).Replace(@"\*", ".*") + "$").ToArray();; } private bool TryGetCredentials(Uri uri, out NetworkCredential credentials)