diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2012-02-19 21:35:41 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2012-02-19 21:35:41 -0800 |
commit | 339d48e68b86344bb611ed1db1050d8c2f569927 (patch) | |
tree | c1495f55f5feb68b0b40ec929533dbbebc71a24b /src/DotNetOpenAuth.OAuth2/OAuth2/ChannelElements | |
parent | 2746ec1fabc080c0ce8b088fa342e5ba1178ba70 (diff) | |
parent | 061794ec18d2e3286194f6db849d9b3b0bedb7b3 (diff) | |
download | DotNetOpenAuth-339d48e68b86344bb611ed1db1050d8c2f569927.zip DotNetOpenAuth-339d48e68b86344bb611ed1db1050d8c2f569927.tar.gz DotNetOpenAuth-339d48e68b86344bb611ed1db1050d8c2f569927.tar.bz2 |
Merge branch 'master' into HEAD
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2/OAuth2/ChannelElements')
-rw-r--r-- | src/DotNetOpenAuth.OAuth2/OAuth2/ChannelElements/OAuth2AuthorizationServerChannel.cs | 1 | ||||
-rw-r--r-- | src/DotNetOpenAuth.OAuth2/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs | 7 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/DotNetOpenAuth.OAuth2/OAuth2/ChannelElements/OAuth2AuthorizationServerChannel.cs b/src/DotNetOpenAuth.OAuth2/OAuth2/ChannelElements/OAuth2AuthorizationServerChannel.cs index 1026018..295ee86 100644 --- a/src/DotNetOpenAuth.OAuth2/OAuth2/ChannelElements/OAuth2AuthorizationServerChannel.cs +++ b/src/DotNetOpenAuth.OAuth2/OAuth2/ChannelElements/OAuth2AuthorizationServerChannel.cs @@ -56,6 +56,7 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements { /// </remarks> protected override OutgoingWebResponse PrepareDirectResponse(IProtocolMessage response) { var webResponse = new OutgoingWebResponse(); + this.ApplyMessageTemplate(response, webResponse); string json = this.SerializeAsJson(response); webResponse.SetResponse(json, new ContentType(JsonEncoded)); return webResponse; diff --git a/src/DotNetOpenAuth.OAuth2/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs b/src/DotNetOpenAuth.OAuth2/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs index cc61d47..1c2a080 100644 --- a/src/DotNetOpenAuth.OAuth2/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs +++ b/src/DotNetOpenAuth.OAuth2/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs @@ -106,10 +106,9 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements { ErrorUtilities.VerifyInternal(unauthorizedResponse != null, "Only unauthorized responses are expected."); // First initialize based on the specifics within the message. - var httpResponse = response as IHttpDirectResponse; - webResponse.Status = httpResponse != null ? httpResponse.HttpStatusCode : HttpStatusCode.Unauthorized; - foreach (string headerName in httpResponse.Headers) { - webResponse.Headers.Add(headerName, httpResponse.Headers[headerName]); + this.ApplyMessageTemplate(response, webResponse); + if (!(response is IHttpDirectResponse)) { + webResponse.Status = HttpStatusCode.Unauthorized; } // Now serialize all the message parts into the WWW-Authenticate header. |