diff options
Diffstat (limited to 'devtools/client/shared/curl.js')
-rw-r--r-- | devtools/client/shared/curl.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/devtools/client/shared/curl.js b/devtools/client/shared/curl.js index 44465193f..420fe6aa5 100644 --- a/devtools/client/shared/curl.js +++ b/devtools/client/shared/curl.js @@ -76,7 +76,8 @@ const Curl = { // Create post data. let postData = []; - if (utils.isUrlEncodedRequest(data) || data.method == "PUT") { + if (utils.isUrlEncodedRequest(data) || + ["PUT", "POST", "PATCH"].includes(data.method)) { postDataText = data.postDataText; postData.push("--data"); postData.push(escapeString(utils.writePostDataTextParams(postDataText))); @@ -207,6 +208,9 @@ const CurlUtils = { * Post data parameters. */ writePostDataTextParams: function (postDataText) { + if (!postDataText) { + return ""; + } let lines = postDataText.split("\r\n"); return lines[lines.length - 1]; }, |