Copy as cURL ignore PATCH data

RESOLVED FIXED in Firefox 59

Status

defect
P3
normal
RESOLVED FIXED
2 years ago
Last year

People

(Reporter: erdnaxeli, Assigned: abhinav.koppula, Mentored)

Tracking

({good-first-bug})

57 Branch
Firefox 59

Firefox Tracking Flags

(firefox59 fixed)

Details

Attachments

(1 attachment)

Reporter

Description

2 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20171115095343

Steps to reproduce:

* go on a website doing a PATCH request
* open the Developer Tools, tab Network
* triggers the PATCH request
* right click on the line corresponding to the request, copy > copy as cURL


Actual results:

I got the curl line with the data.


Expected results:

I should have the curl line with the data. The data is available if I use copy > copy POST Data.
Component: Untriaged → Developer Tools: Netmonitor
Thanks for the report!

For anyone interested, the fix could be around these lines:
https://github.com/mozilla/gecko-dev/blob/master/devtools/client/shared/curl.js#L77
(see that PATCH doesn't seem to be supported)

Honza
Mentor: odvarko
Keywords: good-first-bug
Priority: -- → P3
Comment hidden (mozreview-request)
Assignee

Comment 3

2 years ago
Hi Honza,
I have created a quick patch, does this fix the issue?
(In reply to Abhinav Koppula from comment #3)
> Hi Honza,
> I have created a quick patch, does this fix the issue?

Yes, I am seeing the posted data now. This also needs a test.
I think you might extend the existing one: browser_net_curl-utils.js

Honza
Assignee: nobody → abhinav.koppula
Status: UNCONFIRMED → ASSIGNED
Has STR: --- → yes
Ever confirmed: true
Comment on attachment 8938462 [details]
Bug 1420982 - Fix for copy as cURL ignoring PATCH data.

https://reviewboard.mozilla.org/r/209168/#review215812

Thanks Abhinav!

Only needs a test.
Honza
Attachment #8938462 - Flags: review?(odvarko) → review-
Comment hidden (mozreview-request)
Assignee

Comment 7

2 years ago
Hi Honza,
I have updated my patch with the test.
But eslint is giving an error saying that i have too many nested callbacks.

mozilla-central/devtools/client/netmonitor/test/html_curl-utils.html
  105:34  error  Too many nested callbacks (4). Maximum allowed is 3.  max-nested-callbacks (eslint)

ajaxGet(url, () => {
  ajaxPost(url, () => {
    ajaxPatch(url, () => {
      ajaxMultipart(url, () => {
        submitForm();
      });
    });
  });
});

So i'm guessing that we are nesting since we want the xhrs to be fired in a specific order. 
Should we somehow ignore this eslint rule for this test?
Flags: needinfo?(odvarko)
(In reply to Abhinav Koppula from comment #7)
> Should we somehow ignore this eslint rule for this test?
Yes, you can disable it by putting:

/* eslint-disable max-nested-callbacks */

...at the top of the script (just underneath of:

/* exported performRequests */

Honza
Flags: needinfo?(odvarko)
Comment on attachment 8938462 [details]
Bug 1420982 - Fix for copy as cURL ignoring PATCH data.

https://reviewboard.mozilla.org/r/209168/#review216142

Excellent, looks good to me!

R+

Thanks Abhinav,
Honza
Attachment #8938462 - Flags: review?(odvarko) → review+
Comment hidden (mozreview-request)
Assignee

Comment 11

2 years ago
Hi Honza,
Thanks for the review.
I have fixed the eslint issue as well and have pushed to TRY
https://treeherder.mozilla.org/#/jobs?repo=try&revision=9fea42cb9d7505d8819056e1da7887c102ee0c29
Assignee

Updated

2 years ago
Keywords: checkin-needed

Comment 13

2 years ago
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/d6993ed46421
Fix for copy as cURL ignoring PATCH data. r=Honza
Keywords: checkin-needed

Comment 14

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/d6993ed46421
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 59

Updated

Last year
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.