-
Notifications
You must be signed in to change notification settings - Fork 35
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
Problems validating bewit when url contains spaces encoded as %20 #29
Comments
Further testing shows that foreign characters also cause problems. For example, the word "Solución" is encoded as Soluci%C3%B3n by some frameworks (including .NET in the new Uri() constructor), but HttpValueCollection.ToString() encodes it as %uxxxx, which is not even correctly parsed by the Uri constructor.
|
Thanks for the repro. Let me work on a fix as soon as possible. |
HttpValueCollection.ToString() should probably be replaced, as it encodes in a not very standard way. Could this be a remplacement?
But even after that, we're left with the problem of %20 and + equivalences for encoding a space. |
Thanks! Will you be updating the NuGet package? |
Hi Pablo.
When using urls that have spaces encoded as %20 instead of a plus sign (both are valid, apparently), the code is failing. This is because of a behavior in the object return from
HttpUtility.ParseQueryString(uri.Query)
in the methodRemoveBewitFromQuery
.This object, when
ToString()
is invoked, replaces %20 with the "+" sign. As a consequence, the resulting url doesn't match the original used to generate the mac, and the check fails.A failing test:
The text was updated successfully, but these errors were encountered: