Closed juanfh closed 2 years ago
Without information about where/how this project is deployed and if you're using a reverse proxy on the server and how you're making requests to the API (postman/client app of some sort), I am unable to reproduce this issue. (You deleted the steps to reproduce section of the issue template)
What I wanted to know is if someone has used the filters operators on a production server and if it works well or not, because I haven't found any information about this bug.
My application is uploaded to a server with Debian 11 and Phusion Passenger. The problem is simply that, when I use any operator, the api returns a cors error.
This works: https://myapi.com/api/table?filters[name]=thename This not works: https://myapi.com/api/table?filters[name][$eq]=thename
If someone could confirm that they are using operators in production without problems, I could rule out that it is a Strapi bug and try to find out why it happens to me.
@juanfh I tested on a deployed application and I can't reproduce, we need more information on methods to reproduce the issue.
Marking as closed until we get more information
Hey, i have exactly the same error. All requests are working but only the filter (?populate=*&filters[Slug][$eq]=test) is causing this error.
I hope someone can help.
@juanfh I tested on a deployed application and I can't reproduce, we need more information on methods to reproduce the issue.
Marking as closed until we get more information
I think you can open this issue again ;)
Hello!
Can you please create a new GitHub issue by using the GitHub issue template, providing all required information.
Your issue looks related to that topic but it's an old one. Using another thread (GitHub issue) will be able to manage your case.
Thank you and have a good day.
Bug report
When use an filter operator in the query it fails and throws a cors error:
Describe the bug
If don't use operators all queries works fine in the server but when use any filter operator it gets a cors bug. In localhost all queries work fine (with or without operators).
In the server a query like this https://myapi.com/api/table?filters[name]=thename works fine but https://myapi.com/api/table?filters[name][$eq]=thename gets a cors error:
Access to XMLHttpRequest at 'http://myapi.com/api/...' from origin 'http://myapp.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
This happens when using any filter operator ($eq, $or, $and, $lt, …):
System