Skip to content
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

fix: odata query encoding and DataQuery setQuery #210

Merged
merged 2 commits into from Nov 9, 2022

Conversation

halber
Copy link
Contributor

@halber halber commented Oct 28, 2022

In this pull request two problems are fixed

  1. DataQuery cannot correctly process query strings
    The DataQuery expects a decoded query string in the setQuery method and
    in the constructors that accept a query parameter. These methods are
    now deprecated since this cannot be fixed. A new method setRawQuery is
    introduced which accepts the encoded query string and creates the
    parameters from it.

  2. odata query encoding in EntityVerticle
    The parseUri method expects the query parameter to be in percent
    encoding, but it was decoded.

@halber halber requested a review from a team as a code owner October 28, 2022 05:32
@pk-work
Copy link
Contributor

pk-work commented Oct 28, 2022

Maybe this is the reason why NeonBee was not able to handle single quotes in the past. Please have a look at 4a0665a

This commit contains tests which have failed. Can you add these tests to your change (if you not already have similar ones) to check if this issue is now solved?

@halber
Copy link
Contributor Author

halber commented Oct 28, 2022

Maybe this is the reason why NeonBee was not able to handle single quotes in the past. Please have a look at 4a0665a

This commit contains tests which have failed. Can you add these tests to your change (if you not already have similar ones) to check if this issue is now solved?

I added the test case, but I had to change it a bit to make the test pass.

@halber halber force-pushed the fix/odataQueryEncoding branch 3 times, most recently from cbc005e to 2009459 Compare October 28, 2022 07:52
@halber halber force-pushed the fix/odataQueryEncoding branch 3 times, most recently from 112a0e1 to 27eccee Compare November 4, 2022 10:36
The DataQuery expects a decoded query string in the setQuery method and
in the constructors that accept a query parameter. These methods are
now deprecated since this cannot be fixed. A new method setRawQuery is
introduced which accepts the encoded query string and creates the
parameters from it.
The parseUri method expects the query parameter to be in percent
encoding, but it was decoded.
Copy link

@BenniR6 BenniR6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately a lot of deprecations needed.
I can not see a better idea atm.

@halber halber merged commit ae52053 into main Nov 9, 2022
@halber halber deleted the fix/odataQueryEncoding branch November 9, 2022 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants