summaryrefslogtreecommitdiffstats
path: root/devtools/client/shared/curl.js
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2017-07-30 08:54:14 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-02-12 15:30:02 +0100
commit814bfaddb9bd3d27bfb51e6229db9547177fe159 (patch)
tree22f619665231e9046c422f7e9eb88fb118961ace /devtools/client/shared/curl.js
parent31c0e9aa6891cdc0cbeb81f2277626aa1cc7235a (diff)
downloadUXP-814bfaddb9bd3d27bfb51e6229db9547177fe159.tar
UXP-814bfaddb9bd3d27bfb51e6229db9547177fe159.tar.gz
UXP-814bfaddb9bd3d27bfb51e6229db9547177fe159.tar.lz
UXP-814bfaddb9bd3d27bfb51e6229db9547177fe159.tar.xz
UXP-814bfaddb9bd3d27bfb51e6229db9547177fe159.zip
[regression] DevTools - network - Copy as cURL (http versions)
Diffstat (limited to 'devtools/client/shared/curl.js')
-rw-r--r--devtools/client/shared/curl.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/devtools/client/shared/curl.js b/devtools/client/shared/curl.js
index 978cbad9c..44465193f 100644
--- a/devtools/client/shared/curl.js
+++ b/devtools/client/shared/curl.js
@@ -107,7 +107,13 @@ const Curl = {
// Add http version.
if (data.httpVersion && data.httpVersion != DEFAULT_HTTP_VERSION) {
- command.push("--" + data.httpVersion.split("/")[1]);
+ let version = data.httpVersion.split("/")[1];
+ // curl accepts --http1.0, --http1.1 and --http2 for HTTP/1.0, HTTP/1.1
+ // and HTTP/2 protocols respectively. But the corresponding values in
+ // data.httpVersion are HTTP/1.0, HTTP/1.1 and HTTP/2.0
+ // So in case of HTTP/2.0 (which should ideally be HTTP/2) we are using
+ // only major version, and full version in other cases
+ command.push("--http" + (version == "2.0" ? version.split(".")[0] : version));
}
// Add request headers.