summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-06-15 11:17:28 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-06-15 11:17:28 -0700
commit133da064dac8d79e70c33725d23325243fdfc1e6 (patch)
tree88dfcedb5dd560451b6ee18d11266965b41469e4 /src
parent289591547c432da3bec3396765985632205d8432 (diff)
downloadDotNetOpenAuth-133da064dac8d79e70c33725d23325243fdfc1e6.zip
DotNetOpenAuth-133da064dac8d79e70c33725d23325243fdfc1e6.tar.gz
DotNetOpenAuth-133da064dac8d79e70c33725d23325243fdfc1e6.tar.bz2
Fixes unhandled exception from OpenIdRelyingParty.IsOpenIdSupportingParameter for certain odd query strings.
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs
index 1c82098..7533000 100644
--- a/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs
+++ b/src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingParty.cs
@@ -399,7 +399,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
NameValueCollection queryParams = this.Channel.GetRequestFromContext().QueryStringBeforeRewriting;
var returnToParams = new Dictionary<string, string>(queryParams.Count);
foreach (string key in queryParams) {
- if (!IsOpenIdSupportingParameter(key)) {
+ if (!IsOpenIdSupportingParameter(key) && key != null) {
returnToParams.Add(key, queryParams[key]);
}
}
@@ -510,6 +510,11 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
/// <c>true</c> if the named parameter is a library- or protocol-specific parameter; otherwise, <c>false</c>.
/// </returns>
internal static bool IsOpenIdSupportingParameter(string parameterName) {
+ // Yes, it is possible with some query strings to have a null or empty parameter name
+ if (string.IsNullOrEmpty(parameterName)) {
+ return false;
+ }
+
Protocol protocol = Protocol.Default;
return parameterName.StartsWith(protocol.openid.Prefix, StringComparison.OrdinalIgnoreCase)
|| parameterName.StartsWith(OpenIdUtilities.CustomParameterPrefix, StringComparison.Ordinal);