// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.ComponentModel;
using System.ServiceModel.Security;
using System.Web.Http;
namespace System.Net.Http
{
[EditorBrowsable(EditorBrowsableState.Never)]
public static class HttpRequestMessageExtensions
{
private const string SecurityKey = "Security";
///
/// Gets the current
/// stored in for the given request.
///
/// The HTTP request.
/// The .
public static SecurityMessageProperty GetSecurityMessageProperty(this HttpRequestMessage request)
{
if (request == null)
{
throw Error.ArgumentNull("request");
}
return request.GetProperty(SecurityKey);
}
private static T GetProperty(this HttpRequestMessage request, string key)
{
T value;
request.Properties.TryGetValue(key, out value);
return value;
}
}
}