-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
/users?filter={"where": {"name": {"like": "%ad%"} }} does not work on LB4 #4015
Comments
/users?filter={"where": {"name": {"like": "%ad%"} }} does not work because %ad% is an unknown character when the url is decoded. If I provide anything else such as %Jo%, it works. Only %ad% is not working. Can anybody help me to figure out the solution for it? I am working on loopback 4. |
reproduced the error, looking. words that begin with the first few letters(abcdef) are failing too. |
@jannyHou Try users?filter={"where": {"name": {"like": "%25admin%25"} }}. It has worked here. |
@iury123 👍 Looks like For query like I am not sure why there is a difference, due to the limit of #3770 I tried the endpoints with postman. Should we switch to other parsers like cc @strongloop/loopback-maintainers thought? |
Whatever is parsing I don't think we should change the parser. Interpreting encoding and intend is a very complex task, we never know what new problems a new parser might introduce. Let's keep the current one but make the instructions clear: Kindly encode all special characters, like how @iury123 has done
They belong to the hexadecimal set, that's why. |
You need to url-encode values in the query string. This is usually done for you automatically when using tools like request or creating the query string via Here are the instructions for creating the URL manually:
const filter = {where: {name: {like: '%ad%'}}};
const search = `filter=${encodeURIComponent(JSON.stringify(filter))}`;
const url = `http://localhost:3000/products?${search}`; |
Steps to reproduce
Current Behavior
Expected Behavior
Link to reproduction sandbox
Additional information
Related Issues
See Reporting Issues for more tips on writing good issues
The text was updated successfully, but these errors were encountered: