Repository navigation
Conversation
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.
PR Description
Repeated
-b/--cookieflags were dropped during cURL import: only the lastvalue was kept. curl sends all of them.
Cause: in
packages/curl_parser/lib/models/curl.dart,cookiewas registeredwith
addOption(single value), so each repeated flag overwrote the previous one.Fix:
cookiewithaddMultiOption('cookie', abbr: 'b', splitCommas: false)(same approach as fix(curl_parser): prevent splitting form data values on commas (#1951) #1952 for
-F).;into the existingString? cookiefield. This matchesthe
Cookieheader curl sends, so no model ortoCurlString()changes are needed.-bis not used,cookiestaysnullas before.-b "a=1" -b "b=2"b=2a=1; b=2-b "a=1" -b "b=2" -b "c=3"c=3a=1; b=2; c=3--cookie "a=1" --cookie "b=2"b=2a=1; b=2-b "a=1; b=2" -b "c=3"c=3a=1; b=2; c=3-b "a=1; b=2"(single)a=1; b=2a=1; b=2(unchanged)AI assistance: I used Claude Code to explore the parser code and draft tests.
I've reviewed and understand all changes.
Related Issues
Video Demo
https://screenrec.com/share/CAzGfQknvY (video-proof)
Checklist
mainbranch before making this PRflutter upgradeand verify)flutter test) and all tests are passingNote: tested on Flutter 3.44.9 (meets the project's
>=3.41.2requirement).Added/updated tests?
We encourage you to add relevant test cases.
Added a
repeated -b / --cookie flagstest group inpackages/curl_parser/test/curl_parser_test.dart:-bflags--cookie(long form)-bfollowed by another-b-bwith multiple cookies, and=inside a cookie valueAll
curl_parsertests pass (89 tests).OS on which you have developed and tested the feature?