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.
21 lines
635 B
21 lines
635 B
// Copyright (c) André N. Klingsheim. See License.txt in the project root for license information.
|
|
|
|
using Microsoft.AspNet.Http;
|
|
using NWebsec.Annotations;
|
|
|
|
namespace NWebsec.Core.Extensions
|
|
{
|
|
public static class HttpContextExtensions
|
|
{
|
|
[NotNull]
|
|
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;
|
|
}
|
|
}
|
|
}
|