"Copy as cURL" misses out a bunch of request data

NEW
Unassigned

Status

()

Firefox
Developer Tools: Netmonitor
P2
normal
4 years ago
4 months ago

People

(Reporter: peterbe, Unassigned)

Tracking

35 Branch
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
I have a locally running angularjs app that makes a HTTP POST to the server. It's failing with 400 Bad Request error which is my business to fix. But to make it easier to replicate I use the "Copy as cURL" in the Network panel. Here's what it gives me:

https://gist.github.com/peterbe/2a8d467f1bcde6569d69

This is incomplete.
Clearly it's missing the actual data that is being sent too. Here's the same thing but with using Chrome:

https://gist.github.com/peterbe/a67061d9c386308b2cff

The major difference seems to be the `--data-binary ...` part.
(Reporter)

Comment 1

4 years ago
I can reproduce this locally on my laptop but the site is not anywhere on the net.

Comment 2

3 years ago
Firefox 39 (firefox-39.0-8.fc22.x86_64), I can confirm this bug.

"Copy as cURL" ignores request payload.

Comment 3

2 years ago
ff 43.0.4 on OSX can confirm bug

filling out the form at http://www.lightandfitsweepstake.com/app/home/wizard/register.html generates a POST request with an ASCII payload. When you use the dev tool network panel to copy as curl, it sees the post to /api/Sweepstakes, but it ignores the payload. 

payload from network panel:
{"additionalProperties":{},"imageUrl":[null],"firstName":"fname","lastName":"lname","address1":"address1","city":"city","state":"st","postalCode":"zip","birthDate":"mm/dd/yyyy","email":"emailaddress","phone":"phone","agreeToTerms":true,"optIn2":true}

curl request from "copy as curl"
curl 'http://www.lightandfitsweepstake.com/api/Sweepstakes/' -H 'Host: www.lightandfitsweepstake.com' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:43.0) Gecko/20100101 Firefox/43.0' -H 'Accept: application/json, text/plain, */*' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'Content-Type: application/json;charset=utf-8' -H 'Referer: http://www.lightandfitsweepstake.com/' -H 'Content-Length: 291' -H 'Cookie: _ga=GA1.2.823045280.1452805467; AWSELB=497F378F08458425BB411A15E3A4E51856EF49A0F7874E3F4033B2BF5885FBBD958140ABDF36A0D080A4C98030FE899ADF25C84342A403CABE3CDB6CB66D14D4FDA442D4FE; _gat=1' -H 'Connection: keep-alive'

Comment 4

2 years ago
I can confirm as well on the latest aurora. Might be related to https://bugzilla.mozilla.org/show_bug.cgi?id=1031956 (which has been around unfixed for even longer...)
There is also bug 1269468 that requests POST data body to be included in 'Copy as cURL'

Honza
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.