Repository navigation
fix(curl_parser): support attached short options and combined flags (#1887) - #1959
Open
atharva081106 wants to merge 1 commit into
Open
atharva081106 wants to merge 1 commit into
atharva081106 wants to merge 1 commit into
Conversation
6 of 8 tasks
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
This PR fixes an issue where cURL import silently dropped short options with attached values (e.g.
-XDELETE,-XPUT,-HAccept:...,-d'{...}',-uuser:pass) and combined boolean flags (e.g.-sL,-sSL,-sXPOST).Root Cause
Previously, tokens starting with
-were filtered againstrecognizedAbbrsrequiring an exact string match (e.g.-XDELETE != -X). Consequently, any attached value or combined flag group was discarded as an unknown short option, causing requests to fall back to defaultGETand losing headers, body data, or flags.Changes
-X,-H,-d,-u,-A,-b,-c,-e,-F,-o), it splits the option and the attached value into separate tokens.-sL), it decomposes them into individual flag tokens (-s,-L) while safely dropping unrecognized characters.-sXPOST->-s,-X,POST).packages/curl_parser/test/curl_parser_test.dartcovering all reported scenarios.Related Issues
Video Demo
Direct MP4 Download / Preview:
https://github.com/atharva081106/apidash/releases/download/v0.0.1-demo/curl_parser_demo.mp4
Inline Preview:

Demonstration verifying all 91 unit tests (including 8 new regression tests for #1887) passing 100% cleanly on Windows.
Checklist
mainbranch before making this PRflutter upgradeand verify)flutter test) and all tests are passingAdded/updated tests?
We encourage you to add relevant test cases.
OS on which you have developed and tested the feature?