Backed out 1 changesets (bug 1402828) for failing devtools/client/netmonitor/test/browser_net_copy_as_curl.js r=backout a=backout on a CLOSED TREE
authorAndreea Pavel <apavel@mozilla.com>
Wed, 15 Nov 2017 06:12:53 +0200
changeset 436293 d563998a63ffbc44cf022286322705d190305321
parent 436292 46a0be972d5ae92da4a6dacb21f6e6ff119eb970
child 436294 da16d74f97e28c68cf18c80e2e61b2c441956cfa
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +0000
reviewersbackout, backout
bugs1402828
milestone59.0a1
backs out4d059e20a773dc661f0d2fd45d2118230398f720
Backed out 1 changesets (bug 1402828) for failing devtools/client/netmonitor/test/browser_net_copy_as_curl.js r=backout a=backout on a CLOSED TREE Backed out changeset 4d059e20a773 (bug 1402828)
devtools/client/shared/curl.js
--- a/devtools/client/shared/curl.js
+++ b/devtools/client/shared/curl.js
@@ -83,30 +83,30 @@ const Curl = {
     } else if (multipartRequest) {
       postDataText = data.postDataText;
       postData.push("--data-binary");
       let boundary = utils.getMultipartBoundary(data);
       let text = utils.removeBinaryDataFromMultipartText(postDataText, boundary);
       postData.push(escapeString(text));
       ignoredHeaders.add("content-length");
     }
-    // curl generates the host header itself based on the given URL
-    ignoredHeaders.add("host");
+
+    // Add method.
+    // For GET and POST requests this is not necessary as GET is the
+    // default. If --data or --binary is added POST is the default.
+    if (!(data.method == "GET" || data.method == "POST")) {
+      command.push("-X");
+      command.push(data.method);
+    }
 
     // Add -I (HEAD)
     // For servers that supports HEAD.
     // This will fetch the header of a document only.
     if (data.method == "HEAD") {
       command.push("-I");
-    } else if (!(data.method == "GET" || data.method == "POST")) {
-      // Add method.
-      // For HEAD, GET and POST requests this is not necessary. GET is the
-      // default, if --data or --binary is added POST is used, -I implies HEAD.
-      command.push("-X");
-      command.push(data.method);
     }
 
     // Add request headers.
     let headers = data.headers;
     if (multipartRequest) {
       let multipartHeaders = utils.getHeadersFromMultipartText(postDataText);
       headers = headers.concat(multipartHeaders);
     }