#437 bug decoding encoded +
This commit is contained in:
parent
521d855f33
commit
659e0fcf3f
@ -375,6 +375,14 @@ namespace Flurl.Test
|
||||
Assert.AreEqual("http://www.mysite.com/a+b?c+d=1+2", url.ToString(true));
|
||||
}
|
||||
|
||||
[Test] // #437
|
||||
public void interprets_encoded_plus_as_plus() {
|
||||
var urlStr = "http://google.com/search?q=param_with_%2B";
|
||||
var url = new Url(urlStr);
|
||||
var paramValue = url.QueryParams["q"];
|
||||
Assert.AreEqual("param_with_+", paramValue);
|
||||
}
|
||||
|
||||
[TestCase("http://www.mysite.com/more", true)]
|
||||
[TestCase("http://www.mysite.com/more?x=1&y=2", true)]
|
||||
[TestCase("http://www.mysite.com/more?x=1&y=2#frag", true)]
|
||||
|
@ -144,8 +144,7 @@ namespace Flurl
|
||||
if (string.IsNullOrEmpty(s))
|
||||
return s;
|
||||
|
||||
s = Uri.UnescapeDataString(s);
|
||||
return interpretPlusAsSpace ? s.Replace("+", " ") : s;
|
||||
return Uri.UnescapeDataString(interpretPlusAsSpace ? s.Replace("+", " ") : s);
|
||||
}
|
||||
|
||||
private const int MAX_URL_LENGTH = 65519;
|
||||
|
Loading…
x
Reference in New Issue
Block a user