summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2010-03-07 13:01:01 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2010-03-07 13:28:35 -0800
commit5513ca7174c6681848d0c05c5dc9e79a50ea5b10 (patch)
treebf1f33f8c766e0156c8ba0f0596a76c33ab3751d /src
parent09398b5febaef7834f2dc822161dc73995439c7e (diff)
downloadDotNetOpenAuth-5513ca7174c6681848d0c05c5dc9e79a50ea5b10.zip
DotNetOpenAuth-5513ca7174c6681848d0c05c5dc9e79a50ea5b10.tar.gz
DotNetOpenAuth-5513ca7174c6681848d0c05c5dc9e79a50ea5b10.tar.bz2
Fix for OAuthChannel.ReadFromRequestCore throwing an unhandled ArgumentNullException when a POST entity contains an unexpected null key in a key=value format entity.
Fixes Trac #183
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth/OAuth/ChannelElements/OAuthChannel.cs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthChannel.cs b/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthChannel.cs
index 1af2d7e..036c19a 100644
--- a/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthChannel.cs
+++ b/src/DotNetOpenAuth/OAuth/ChannelElements/OAuthChannel.cs
@@ -145,7 +145,11 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
ContentType contentType = new ContentType(request.Headers[HttpRequestHeader.ContentType]);
if (string.Equals(contentType.MediaType, HttpFormUrlEncoded, StringComparison.Ordinal)) {
foreach (string key in request.Form) {
- fields.Add(key, request.Form[key]);
+ if (key != null) {
+ fields.Add(key, request.Form[key]);
+ } else {
+ Logger.OAuth.WarnFormat("Ignoring query string parameter '{0}' since it isn't a standard name=value parameter.", request.Form[key]);
+ }
}
}
}