diff options
Diffstat (limited to 'src/DotNetOpenAuth.Core/Messaging/Channel.cs')
-rw-r--r-- | src/DotNetOpenAuth.Core/Messaging/Channel.cs | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/DotNetOpenAuth.Core/Messaging/Channel.cs b/src/DotNetOpenAuth.Core/Messaging/Channel.cs index 2e4da38..16e39d3 100644 --- a/src/DotNetOpenAuth.Core/Messaging/Channel.cs +++ b/src/DotNetOpenAuth.Core/Messaging/Channel.cs @@ -602,6 +602,7 @@ namespace DotNetOpenAuth.Messaging { /// Gets the HTTP context for the current HTTP request. /// </summary> /// <returns>An HttpContextBase instance.</returns> + [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Allocates memory")] protected internal virtual HttpContextBase GetHttpContext() { Requires.ValidState(HttpContext.Current != null, MessagingStrings.HttpContextRequired); return new HttpContextWrapper(HttpContext.Current); @@ -644,6 +645,22 @@ namespace DotNetOpenAuth.Messaging { } /// <summary> + /// Applies message prescribed HTTP response headers to an outgoing web response. + /// </summary> + /// <param name="message">The message.</param> + /// <param name="response">The HTTP response.</param> + protected static void ApplyMessageTemplate(IMessage message, OutgoingWebResponse response) { + Requires.NotNull(message, "message"); + var httpMessage = message as IHttpDirectResponse; + if (httpMessage != null) { + response.Status = httpMessage.HttpStatusCode; + foreach (string headerName in httpMessage.Headers) { + response.Headers.Add(headerName, httpMessage.Headers[headerName]); + } + } + } + + /// <summary> /// Releases unmanaged and - optionally - managed resources /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> @@ -1044,22 +1061,6 @@ namespace DotNetOpenAuth.Messaging { } /// <summary> - /// Applies message prescribed HTTP response headers to an outgoing web response. - /// </summary> - /// <param name="message">The message.</param> - /// <param name="response">The HTTP response.</param> - protected void ApplyMessageTemplate(IMessage message, OutgoingWebResponse response) { - Requires.NotNull(message, "message"); - var httpMessage = message as IHttpDirectResponse; - if (httpMessage != null) { - response.Status = httpMessage.HttpStatusCode; - foreach (string headerName in httpMessage.Headers) { - response.Headers.Add(headerName, httpMessage.Headers[headerName]); - } - } - } - - /// <summary> /// Prepares to send a request to the Service Provider as the query string in a GET request. /// </summary> /// <param name="requestMessage">The message to be transmitted to the ServiceProvider.</param> |