You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
590 B
19 lines
590 B
// Copyright (c) André N. Klingsheim. See License.txt in the project root for license information.
|
|
|
|
using Microsoft.AspNet.Http;
|
|
|
|
namespace NWebsec.Core.Extensions
|
|
{
|
|
public static class HttpContextExtensions
|
|
{
|
|
public static NWebsecContext GetNWebsecContext(this HttpContext context)
|
|
{
|
|
if (!context.Items.ContainsKey(NWebsecContext.ContextKey))
|
|
{
|
|
context.Items[NWebsecContext.ContextKey] = new NWebsecContext();
|
|
}
|
|
|
|
return context.Items[NWebsecContext.ContextKey] as NWebsecContext;
|
|
}
|
|
}
|
|
}
|