Skip to content

Commit 17b8765

Browse files
authored
Fix plus decoding (#379)
1 parent 409add7 commit 17b8765

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Microsoft.Owin/Infrastructure/OwinHelpers.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,8 @@ internal static void ParseDelimited(string text, char[] delimiters, Action<strin
562562
string value = text.Substring(equalIndex + 1, delimiterIndex - equalIndex - 1);
563563
if (decodePlus)
564564
{
565-
name.Replace('+', ' ');
566-
value.Replace('+', ' ');
565+
name = name.Replace('+', ' ');
566+
value = value.Replace('+', ' ');
567567
}
568568
if (decodeKey)
569569
{

tests/Microsoft.Owin.Tests/QueryTests.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class QueryTests
1212
private static readonly string[] RawValues = new[] { "v1", "v2, v3", "\"v4, b\"", "v5, v6", "v7", };
1313
private const string JoinedValues = "v1,v2, v3,\"v4, b\",v5, v6,v7";
1414

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

1717
[Fact]
1818
public void ParseQuery()
@@ -28,6 +28,7 @@ public void ParseQuery()
2828
Assert.Equal("v3,v4", query.Get("q3"));
2929
Assert.Null(query.Get("q4"));
3030
Assert.Equal("v5,v5", query.Get("Q5"));
31+
Assert.Equal("v 6", query.Get("Q 6"));
3132
}
3233

3334
[Fact]

0 commit comments

Comments
 (0)