updates method to use the available request instance instead of using HttpContext.Current! no idea why it was using that.

This commit is contained in:
Shannon
2015-10-15 17:07:46 +02:00
parent c514ce8da3
commit 2c11f0be0f

View File

@@ -32,7 +32,7 @@ namespace Umbraco.Web
/// <returns></returns>
public static string GetItemAsString(this HttpRequest request, string key, string valueIfNotFound = "")
{
return new HttpRequestWrapper(request).GetItemAsString(key);
return new HttpRequestWrapper(request).GetItemAsString(key, valueIfNotFound);
}
/// <summary>
@@ -44,7 +44,7 @@ namespace Umbraco.Web
/// <returns></returns>
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
/// <returns></returns>
public static T GetItemAs<T>(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();