Repository navigation
Conversation
The credentials mode does not cause a preflight; only a non-safelisted method, non-safelisted headers or an upload listener do. Flagging it made every credentialed simple GET log the preflight warning and get the "not a CORS simple request" error hint. Closes cfug#2634 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
collectCorsPreflightReasons(added in #2556) listswithCredentialsas a preflight reason. Credentials mode does not trigger a preflight; only a non-safelisted method, non-safelisted headers or an upload listener do (MDN, Requests with credentials: a credentialed simpleGET"is not preflighted"). As a result,BrowserHttpClientAdapter(withCredentials: true)logs the "will trigger a preflight (OPTIONS) request" warning on every simple GET, and network errors on such requests get a misleading "not a CORS simple request" hint.Fix: drop the credentials reason and the now-unused
withCredentialsparameter.cors.dartlives underlib/srcand isn't exported, so no public API changes.Closes #2634 (auto-closed only because the wrong issue template was used).
Tests: removed the test that asserted the wrong behaviour and the
withCredentialscase from the combined test.dart test -p vm test/cors_preflight_test.dart(22 tests) anddart analyze --fatal-infospass ondio_web_adapter.Unverified: the browser test suite (
-p chrome) wasn't run locally; the adapter change is the removal of one named argument.Implementation and tests by Claude Code (Claude Opus 5.5); reviewed and submitted by me.
New Pull Request Checklist
mainbranch to avoid conflicts (via merge from master or rebase)dart:developerlog, so there is no new failing test)CHANGELOG.mdin the corresponding package