From 1202c9e6d0a58817666180ba5763f109d1ce3ac6 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 23 Feb 2013 10:02:04 -0800 Subject: [PATCH] Removed strict mocker from available update tests --- NzbDrone.Common/HttpProvider.cs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/NzbDrone.Common/HttpProvider.cs b/NzbDrone.Common/HttpProvider.cs index 22b12dcef..04c7a074f 100644 --- a/NzbDrone.Common/HttpProvider.cs +++ b/NzbDrone.Common/HttpProvider.cs @@ -12,12 +12,10 @@ namespace NzbDrone.Common { private readonly EnvironmentProvider _environmentProvider; private static readonly Logger logger = LogManager.GetCurrentClassLogger(); - private readonly string _userAgent; public HttpProvider(EnvironmentProvider environmentProvider) { _environmentProvider = environmentProvider; - _userAgent = String.Format("NzbDrone {0}", _environmentProvider.Version); } public HttpProvider() @@ -39,7 +37,6 @@ namespace NzbDrone.Common try { var client = new WebClient { Credentials = identity }; - client.Headers.Add(HttpRequestHeader.UserAgent, _userAgent); return client.DownloadString(address); } catch (Exception ex) @@ -52,7 +49,7 @@ namespace NzbDrone.Common public virtual Stream DownloadStream(string url, NetworkCredential credential) { var request = (HttpWebRequest)WebRequest.Create(url); - request.UserAgent = _userAgent; + request.UserAgent = String.Format("NzbDrone {0}", _environmentProvider.Version); request.Credentials = credential; var response = request.GetResponse(); @@ -74,7 +71,6 @@ namespace NzbDrone.Common var stopWatch = Stopwatch.StartNew(); var webClient = new WebClient(); - webClient.Headers.Add(HttpRequestHeader.UserAgent, _userAgent); webClient.DownloadFile(url, fileName); stopWatch.Stop(); logger.Trace("Downloading Completed. took {0:0}s", stopWatch.Elapsed.Seconds);