-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double escaping and + symbol #3580
Comments
One way to get out of this "mess" is to use the query string - that goes through a lot less processing and is far more predictable. |
Thanks at the moment I am using the following workaround:
|
Anyway I still do not get why there is a partial double unescaping of the value. In my case the '+' is double unescaped while the other characters only once. |
Decoding plus to space is not appropriate for the path, I don't know why it's doing that. |
My guess is that it is interpreting the '+' sign as a concatenation symbol (like in query string), so space is the logic decoding |
I solved the problem. To get the correct encoding and decoding use double escaping with |
With .NET Core 2.1 and double escaping just the '+' sign is unescaped twice from the framework instead of once.
My code is as follow:
I than have created a web.config in the project folder to enable the double escaping for IIS/IISExpress
A call for product code
FMB+FTR97/MB06
with double escaping would behttp://localhost:4198/api/v1/warehouse/article/FMB%252BFTR97%252FMB06/movements/1946127
The anomaly (at least for me) is the product code the fw resolves, because I receive:
FMB+FTR97%2FMB06
instead ofFMB%2BFTR97%2FMB06
and when I call WebUtility.UrlDecode(productCode) I than getFMB FTR97/MB06
that is wrong.At first I though was an IIS problem, but I tried the same code with ASP.NET 4.6 (with HttpUtilities.UrlDecode) and it worked as expected, I got
FMB%2BFTR97%2FMB06
Am I using the web.config in the wrong way?
The text was updated successfully, but these errors were encountered: