Replacing NotNullAttribute with thrown exceptions
This commit is contained in:
parent
d41f2ccf71
commit
003ad891d0
|
|
@ -6,7 +6,6 @@ using System.Net;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.Builder;
|
using Microsoft.AspNet.Builder;
|
||||||
using Microsoft.AspNet.Http;
|
using Microsoft.AspNet.Http;
|
||||||
using Microsoft.Extensions.Internal;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.HttpOverrides
|
namespace Microsoft.AspNet.HttpOverrides
|
||||||
{
|
{
|
||||||
|
|
@ -21,8 +20,18 @@ namespace Microsoft.AspNet.HttpOverrides
|
||||||
private readonly OverrideHeaderMiddlewareOptions _options;
|
private readonly OverrideHeaderMiddlewareOptions _options;
|
||||||
private readonly RequestDelegate _next;
|
private readonly RequestDelegate _next;
|
||||||
|
|
||||||
public OverrideHeaderMiddleware([NotNull] RequestDelegate next, [NotNull] OverrideHeaderMiddlewareOptions options)
|
public OverrideHeaderMiddleware(RequestDelegate next, OverrideHeaderMiddlewareOptions options)
|
||||||
{
|
{
|
||||||
|
if (next == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(next));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException(nameof(options));
|
||||||
|
}
|
||||||
|
|
||||||
_options = options;
|
_options = options;
|
||||||
_next = next;
|
_next = next;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,7 @@
|
||||||
"url": "git://github.com/aspnet/basicmiddleware"
|
"url": "git://github.com/aspnet/basicmiddleware"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.AspNet.Http.Extensions": "1.0.0-*",
|
"Microsoft.AspNet.Http.Extensions": "1.0.0-*"
|
||||||
"Microsoft.Extensions.NotNullAttribute.Sources": { "version": "1.0.0-*", "type": "build" }
|
|
||||||
},
|
},
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
"dnx451": { },
|
"dnx451": { },
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue