Flurl: Breaking change: SetQueryParam appears to always encode spaces as pluses in v2.5.2

Created on 18 Dec 2017  路  3Comments  路  Source: tmenier/Flurl

The following

"https://www.google.com"
    .SetQueryParam("utm_source", "some source")
    .ToString()

Returns the following results

| Flurl v2.5.2 | Flurl v2.5.1 |
| ------------- | ------------- |
| https://www.google.com?utm_source=some+source | https://www.google.com?utm_source=some%20source |

I get the same results even if encodeSpaceAsPlus is set to false

var encodeSpaceAsPlus = false

"https://www.google.com"
    .SetQueryParam("utm_source", "some source")
    .ToString(encodeSpaceAsPlus)

Returns the following results

| Flurl v2.5.2 | Flurl v2.5.1 |
| ------------- | ------------- |
| https://www.google.com?utm_source=some+source | https://www.google.com?utm_source=some%20source |

bug

Most helpful comment

Fix is released, please test and let me know if everything appears to be back to the way it was. https://www.nuget.org/packages/Flurl/2.6.0

All 3 comments

Thanks for reporting. This was an unintentional consequence of switching from Uri.EscapeDataString to WebUtility.UrlEncode to fix #185. My test coverage wasn't as good as I thought here. I'll give this top priority and release a fix soon.

Fix is released, please test and let me know if everything appears to be back to the way it was. https://www.nuget.org/packages/Flurl/2.6.0

Was this page helpful?
0 / 5 - 0 ratings