Code review cleanup.
This commit is contained in:
parent
b9899fc72a
commit
732ae3d030
|
|
@ -23,7 +23,7 @@ namespace Microsoft.AspNet.Abstractions
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(value) && value[0] != '?')
|
if (!string.IsNullOrEmpty(value) && value[0] != '?')
|
||||||
{
|
{
|
||||||
throw new ArgumentException("The leading '?' must be included for a non-empty query.");
|
throw new ArgumentException("The leading '?' must be included for a non-empty query.", "value");
|
||||||
}
|
}
|
||||||
_value = value;
|
_value = value;
|
||||||
}
|
}
|
||||||
|
|
@ -51,7 +51,7 @@ namespace Microsoft.AspNet.Abstractions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool HasValue
|
public bool HasValue
|
||||||
{
|
{
|
||||||
get { return !String.IsNullOrEmpty(_value); }
|
get { return !string.IsNullOrEmpty(_value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
@ -75,7 +75,7 @@ namespace Microsoft.AspNet.Abstractions
|
||||||
public string ToUriComponent()
|
public string ToUriComponent()
|
||||||
{
|
{
|
||||||
// Escape things properly so System.Uri doesn't mis-interpret the data.
|
// Escape things properly so System.Uri doesn't mis-interpret the data.
|
||||||
return HasValue ? _value.Replace("#", "%23") : String.Empty;
|
return HasValue ? _value.Replace("#", "%23") : string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ namespace Microsoft.AspNet.PipelineCore
|
||||||
public class DefaultCanHasRequestCookies : ICanHasRequestCookies
|
public class DefaultCanHasRequestCookies : ICanHasRequestCookies
|
||||||
{
|
{
|
||||||
private readonly IFeatureCollection _features;
|
private readonly IFeatureCollection _features;
|
||||||
private FeatureReference<IHttpRequestInformation> _request = FeatureReference<IHttpRequestInformation>.Default;
|
private readonly FeatureReference<IHttpRequestInformation> _request = FeatureReference<IHttpRequestInformation>.Default;
|
||||||
private string _cookiesHeader;
|
private string _cookiesHeader;
|
||||||
private RequestCookiesCollection _cookiesCollection;
|
private RequestCookiesCollection _cookiesCollection;
|
||||||
private static readonly string[] ZeroHeaders = new string[0];
|
private static readonly string[] ZeroHeaders = new string[0];
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ namespace Microsoft.AspNet.PipelineCore
|
||||||
public class DefaultCanHasResponseCookies : ICanHasResponseCookies
|
public class DefaultCanHasResponseCookies : ICanHasResponseCookies
|
||||||
{
|
{
|
||||||
private readonly IFeatureCollection _features;
|
private readonly IFeatureCollection _features;
|
||||||
private FeatureReference<IHttpResponseInformation> _request = FeatureReference<IHttpResponseInformation>.Default;
|
private readonly FeatureReference<IHttpResponseInformation> _request = FeatureReference<IHttpResponseInformation>.Default;
|
||||||
private IResponseCookiesCollection _cookiesCollection;
|
private IResponseCookiesCollection _cookiesCollection;
|
||||||
|
|
||||||
public DefaultCanHasResponseCookies(IFeatureCollection features)
|
public DefaultCanHasResponseCookies(IFeatureCollection features)
|
||||||
|
|
@ -21,9 +21,9 @@ namespace Microsoft.AspNet.PipelineCore
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var headers = _request.Fetch(_features).Headers;
|
|
||||||
if (_cookiesCollection == null)
|
if (_cookiesCollection == null)
|
||||||
{
|
{
|
||||||
|
var headers = _request.Fetch(_features).Headers;
|
||||||
_cookiesCollection = new ResponseCookiesCollection(new HeaderDictionary(headers));
|
_cookiesCollection = new ResponseCookiesCollection(new HeaderDictionary(headers));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue