From d6888a866b6b6e63355a7e058bb0d42da0c91575 Mon Sep 17 00:00:00 2001 From: "Raymond Etornam Agbeame(:retornam)" Date: Fri, 29 Aug 2014 15:49:01 -0700 Subject: [PATCH] Bug 1052856 - Copy as curl should use --compressed instead of -H accept-encoding gzip r=jryans --- browser/devtools/netmonitor/test/browser_net_copy_as_curl.js | 4 ++-- browser/devtools/shared/Curl.jsm | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/browser/devtools/netmonitor/test/browser_net_copy_as_curl.js b/browser/devtools/netmonitor/test/browser_net_copy_as_curl.js index 6cff1456f6d4..e67f67326c87 100644 --- a/browser/devtools/netmonitor/test/browser_net_copy_as_curl.js +++ b/browser/devtools/netmonitor/test/browser_net_copy_as_curl.js @@ -16,7 +16,7 @@ function test() { "-H 'User-Agent: " + aDebuggee.navigator.userAgent + "'", "-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'", "-H 'Accept-Language: " + aDebuggee.navigator.language + "'", - "-H 'Accept-Encoding: gzip, deflate'", + "--compressed", "-H 'X-Custom-Header-1: Custom value'", "-H 'X-Custom-Header-2: 8.8.8.8'", "-H 'X-Custom-Header-3: Mon, 3 Mar 2014 11:11:11 GMT'", @@ -31,7 +31,7 @@ function test() { '-H "User-Agent: ' + aDebuggee.navigator.userAgent + '"', '-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"', '-H "Accept-Language: ' + aDebuggee.navigator.language + '"', - '-H "Accept-Encoding: gzip, deflate"', + "--compressed", '-H "X-Custom-Header-1: Custom value"', '-H "X-Custom-Header-2: 8.8.8.8"', '-H "X-Custom-Header-3: Mon, 3 Mar 2014 11:11:11 GMT"', diff --git a/browser/devtools/shared/Curl.jsm b/browser/devtools/shared/Curl.jsm index 615c3fc0662c..dc7fd37fc539 100644 --- a/browser/devtools/shared/Curl.jsm +++ b/browser/devtools/shared/Curl.jsm @@ -120,6 +120,10 @@ this.Curl = { } for (let i = 0; i < headers.length; i++) { let header = headers[i]; + if (header.name === "Accept-Encoding"){ + command.push("--compressed"); + continue; + } if (ignoredHeaders.has(header.name)) { continue; }