I’m facing issues with CORS preflight requests in my Flutter web integration tests. Here’s a summary of my setup and the problem:
Setup:
- Flutter Web Integration Tests: Using
flutter drive
. - Backend APIs: External APIs used for testing.
- Local Proxy Server: Using Express.js to handle CORS and proxy requests.
Problem:
When running tests on Flutter web, CORS preflight requests (OPTIONS) are triggered for my API calls, causing issues. These preflight requests don’t occur on Android and iOS.
What I Have Tried:
- Proxy Server: Configured to handle CORS and forward requests to the actual APIs.
- Chrome Configuration: Ran Chrome with web security disabled for testing.
Question:
Is there a better way to handle or avoid CORS preflight requests in this setup? Any tips on configuring the proxy or Flutter tests to bypass these preflight requests?
Thanks in advance!