summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
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);