Fix Copy as cURL omitting headers and body on failed requests - #9963
Open
muhammadkamel wants to merge 3 commits into
Open
Fix Copy as cURL omitting headers and body on failed requests#9963muhammadkamel wants to merge 3 commits into
muhammadkamel wants to merge 3 commits into
Conversation
Timed-out and cancelled POSTs never complete a response, so the Network profiler dropped request data from the generated curl command.
muhammadkamel
requested review from
a team,
bkonyi,
kenzieschmoll and
srawlins
as code owners
August 17, 2026 08:28
Contributor
There was a problem hiding this comment.
Code Review
This pull request enhances the "Copy as cURL" feature in the network profiler to include request headers and bodies for failed, timed-out, or cancelled requests, and adds corresponding tests. The review feedback identifies two critical areas where asynchronous calls to getFullRequestData() using unawaited could lead to unhandled exceptions, recommending the use of try-catch blocks or .catchError to handle potential errors gracefully.
Merge upstream master to resolve merge conflicts and pick up pinned GitHub Actions (fixes zizmor-output). Handle getFullRequestData failures gracefully when copying as cURL or prefetching request data.
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.
Summary
curl --location --request POST 'url'even though the app had sent JSON and headers.This is a Network profiler bug found while copying a timed-out
POSTfrom DevTools. There is no open issue for the missing body; related history: #3042 (original Copy as cURL), #9828 (copy request like the browser).Test plan
flutter test packages/devtools_app/test/http/curl_command_test.dartflutter test packages/devtools_app/test/screens/network/network_model_test.dart--headerand--data-rawPre-launch Checklist
General checklist
///).Issues checklist
contributions-welcomeorgood-first-issuelabel.contributions-welcome] or [good-first-issue] label. I understand this means my PR might take longer to be reviewed.Tests checklist
AI-tooling checklist
Feature-change checklist
release-notes-not-requiredlabel or left a comment requesting the label be added.packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.