From 2c11f0be0f4e6690e13deac10f8c4c2d03b98660 Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 15 Oct 2015 17:07:46 +0200 Subject: [PATCH] updates method to use the available request instance instead of using HttpContext.Current! no idea why it was using that. --- src/Umbraco.Web/HttpRequestExtensions.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web/HttpRequestExtensions.cs b/src/Umbraco.Web/HttpRequestExtensions.cs index e700f96571..d7f9e409c8 100644 --- a/src/Umbraco.Web/HttpRequestExtensions.cs +++ b/src/Umbraco.Web/HttpRequestExtensions.cs @@ -32,7 +32,7 @@ namespace Umbraco.Web /// public static string GetItemAsString(this HttpRequest request, string key, string valueIfNotFound = "") { - return new HttpRequestWrapper(request).GetItemAsString(key); + return new HttpRequestWrapper(request).GetItemAsString(key, valueIfNotFound); } /// @@ -44,7 +44,7 @@ namespace Umbraco.Web /// public static string GetItemAsString(this HttpRequestBase request, string key, string valueIfNotFound = "") { - var val = HttpContext.Current.Request[key]; + var val = request[key]; return !val.IsNullOrWhiteSpace() ? val : valueIfNotFound; } @@ -57,7 +57,7 @@ namespace Umbraco.Web /// public static T GetItemAs(this HttpRequestBase request, string key) { - var val = HttpContext.Current.Request[key]; + var val = request[key]; var whitespaceCheck = !val.IsNullOrWhiteSpace() ? val : string.Empty; if (whitespaceCheck.IsNullOrWhiteSpace()) return (T) typeof (T).GetDefaultValue();