Skip to content

Commit

Permalink
Fix plus decoding (#379)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tratcher authored Sep 3, 2020
1 parent 409add7 commit 17b8765
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Microsoft.Owin/Infrastructure/OwinHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,8 @@ internal static void ParseDelimited(string text, char[] delimiters, Action<strin
string value = text.Substring(equalIndex + 1, delimiterIndex - equalIndex - 1);
if (decodePlus)
{
name.Replace('+', ' ');
value.Replace('+', ' ');
name = name.Replace('+', ' ');
value = value.Replace('+', ' ');
}
if (decodeKey)
{
Expand Down
3 changes: 2 additions & 1 deletion tests/Microsoft.Owin.Tests/QueryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class QueryTests
private static readonly string[] RawValues = new[] { "v1", "v2, v3", "\"v4, b\"", "v5, v6", "v7", };
private const string JoinedValues = "v1,v2, v3,\"v4, b\",v5, v6,v7";

private const string OriginalQueryString = "q1=v1;q2=v2,b;q3=v3;q3=v4;q4;q5=v5;q5=v5";
private const string OriginalQueryString = "q1=v1;q2=v2,b;q3=v3;q3=v4;q4;q5=v5;q5=v5;q+6=v+6";

[Fact]
public void ParseQuery()
Expand All @@ -28,6 +28,7 @@ public void ParseQuery()
Assert.Equal("v3,v4", query.Get("q3"));
Assert.Null(query.Get("q4"));
Assert.Equal("v5,v5", query.Get("Q5"));
Assert.Equal("v 6", query.Get("Q 6"));
}

[Fact]
Expand Down

0 comments on commit 17b8765

Please sign in to comment.