diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2013-06-09 18:13:03 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2013-06-09 18:13:03 -0700 |
commit | f3ae2b709b17c48dbc8a2da2b58f4c5f0a807304 (patch) | |
tree | c8f47659e6a90742fdf20b9ff9d5ee7ee3e41b77 /src | |
parent | da9e554cd6364ac1bcf7ab23a8b5fe20e8a26192 (diff) | |
download | DotNetOpenAuth-f3ae2b709b17c48dbc8a2da2b58f4c5f0a807304.zip DotNetOpenAuth-f3ae2b709b17c48dbc8a2da2b58f4c5f0a807304.tar.gz DotNetOpenAuth-f3ae2b709b17c48dbc8a2da2b58f4c5f0a807304.tar.bz2 |
Fixes the CopyHeadersFrom helper method as a better approach to replace commit da9e554cd6364ac1bcf7ab23a8b5fe20e8a26192.
Diffstat (limited to 'src')
-rw-r--r-- | src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs b/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs index cfb9da3..337c86d 100644 --- a/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs +++ b/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs @@ -1205,8 +1205,13 @@ namespace DotNetOpenAuth.Messaging { foreach (string headerName in request.Headers) { string[] headerValues = request.Headers.GetValues(headerName); - if (!message.Headers.TryAddWithoutValidation(headerName, headerValues)) { - message.Content.Headers.TryAddWithoutValidation(headerName, headerValues); + if (headerName == "Authorization" && headerValues.Length > 1) { + // The TryAddWithoutValidation doesn't do this quite right, so do it by hand. + message.Headers.Authorization = AuthenticationHeaderValue.Parse(string.Join(",", headerValues)); + } else { + if (!message.Headers.TryAddWithoutValidation(headerName, headerValues)) { + message.Content.Headers.TryAddWithoutValidation(headerName, headerValues); + } } } } |