You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[web_adapter] CORS warning claims withCredentials forces a preflight, so every credentialed simple request is flagged #2634
Package: web_adapter Version: 2.2.2 (main @ f1bef46) Operating-System: Web Adapter: Default Dio Dart Version: 3.12.2
collectCorsPreflightReasons treats withCredentials: true as a preflight trigger. That isn't how CORS works: preflight depends only on the method, the request headers and upload listeners, not on credentials mode (Fetch spec "main fetch" step; MDN: "a simple GET request is not preflighted" even with credentials). As a result, BrowserHttpClientAdapter(withCredentials: true) logs the "will trigger a preflight (OPTIONS) request" warning on every plain GET, and any network error on such a request gets a misleading "not a CORS simple request" hint.
[]
[withCredentials is enabled, which requires a CORS preflight request]
Cause: plugins/web_adapter/lib/src/cors.dart:77-81 (used at adapter_impl.dart:85-89 for both the warning and the onError message).
Suggested fix: drop the withCredentials reason from collectCorsPreflightReasons. If a credentials hint is still useful, add it only to the onError message, worded as "the server must send Access-Control-Allow-Credentials: true and a non-wildcard origin".
Activity
github-actions commentedon Nov 3, 2026
@uveshm003 Infra and blank issues are only available for moderators. You're apparently using the wrong issue template.