mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-26 09:07:30 +09:00
[devtools] Port various upstream fixes
This commit is contained in:
parent
4f72c20f83
commit
105c7abd40
1 changed files with 9 additions and 3 deletions
|
|
@ -91,7 +91,7 @@ const Curl = {
|
||||||
if (utils.isUrlEncodedRequest(data) ||
|
if (utils.isUrlEncodedRequest(data) ||
|
||||||
["PUT", "POST", "PATCH"].includes(data.method)) {
|
["PUT", "POST", "PATCH"].includes(data.method)) {
|
||||||
postDataText = data.postDataText;
|
postDataText = data.postDataText;
|
||||||
addPostData("--data");
|
addPostData("--data-raw");
|
||||||
addPostData(utils.writePostDataTextParams(postDataText));
|
addPostData(utils.writePostDataTextParams(postDataText));
|
||||||
ignoredHeaders.add("content-length");
|
ignoredHeaders.add("content-length");
|
||||||
} else if (multipartRequest) {
|
} else if (multipartRequest) {
|
||||||
|
|
@ -400,7 +400,12 @@ const CurlUtils = {
|
||||||
* Credit: Google DevTools
|
* Credit: Google DevTools
|
||||||
*/
|
*/
|
||||||
escapeStringWin: function (str) {
|
escapeStringWin: function (str) {
|
||||||
/* Replace quote by double quote (but not by \") because it is
|
/*
|
||||||
|
Replace dollar sign because of commands (e.g $(cmd.exe)) in
|
||||||
|
powershell when using double quotes.
|
||||||
|
Useful details http://www.rlmueller.net/PowerShellEscape.htm
|
||||||
|
|
||||||
|
Replace quote by double quote (but not by \") because it is
|
||||||
recognized by both cmd.exe and MS Crt arguments parser.
|
recognized by both cmd.exe and MS Crt arguments parser.
|
||||||
|
|
||||||
Replace % by "%" because it could be expanded to an environment
|
Replace % by "%" because it could be expanded to an environment
|
||||||
|
|
@ -414,7 +419,8 @@ const CurlUtils = {
|
||||||
Replace new line outside of quotes since cmd.exe doesn't let
|
Replace new line outside of quotes since cmd.exe doesn't let
|
||||||
to do it inside.
|
to do it inside.
|
||||||
*/
|
*/
|
||||||
return "\"" + str.replace(/"/g, "\"\"")
|
return "\"" + str.replace(/\$/g, "`$")
|
||||||
|
.replace(/"/g, "\"\"")
|
||||||
.replace(/%/g, "\"%\"")
|
.replace(/%/g, "\"%\"")
|
||||||
.replace(/\\/g, "\\\\")
|
.replace(/\\/g, "\\\\")
|
||||||
.replace(/[\r\n]+/g, "\"^$&\"") + "\"";
|
.replace(/[\r\n]+/g, "\"^$&\"") + "\"";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue