Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

解决Cookie 中存在“,”造成登录无法验证问题 #2947

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/Nancy/Extensions/CollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ public static class CollectionExtensions
/// <returns>An <see cref="IDictionary{TKey,TValue}"/> instance.</returns>
public static IDictionary<string, IEnumerable<string>> ToDictionary(this NameValueCollection source)
{
return source.AllKeys.ToDictionary<string, string, IEnumerable<string>>(key => key, source.GetValues);
return source.AllKeys.ToDictionary<string, string, IEnumerable<string>>(key => key, key =>
{
var ret = source.GetValues(key);
if (key == "Cookie")
{
return new string[] { string.Join(string.Empty, ret) };
}
return ret;
});
}

/// <summary>
Expand Down Expand Up @@ -85,4 +93,4 @@ public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TS
}
}
}
}
}