Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(627)

Unified Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js

Issue 2182213006: [Devtools] Fix multi-line curl copy response when multi-part-form (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed windows curl with multi-line Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/inspector/curl-command-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
index 3e8c48459315aeac5e765d59755ca51643fb8c3e..e0a5940f50e1f75ac4b6fcd15deec8ffbbe00843 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
@@ -1377,10 +1377,13 @@ WebInspector.NetworkLogView.prototype = {
Replace new line outside of quotes since cmd.exe doesn't let
to do it inside.
*/
- return "\"" + str.replace(/"/g, "\"\"")
- .replace(/%/g, "\"%\"")
- .replace(/\\/g, "\\\\")
- .replace(/[\r\n]+/g, "\"^$&\"") + "\"";
+ var encapsChars = /[\r\n]/.test(str) ? "^\"" : "\"";
lushnikov 2016/07/27 20:16:18 are you sure you want to have /[\r\n]/ and not /\r
allada 2016/07/27 22:27:59 This is simply checking to see if there are any ne
+ return encapsChars + str.replace(/\\/g, "\\\\")
+ .replace(/"/g, "\\\"")
+ .replace(/\^/g, "^^")
+ .replace(/[^a-zA-Z0-9\s_\-:=+~'^\/.',?;()*`]/g, "^$&")
+ .replace(/%(?=[a-zA-Z0-9_])/g, "%^")
+ .replace(/\r\n|[\n\r]/g, "^\n\n") + encapsChars;
}
function escapeStringPosix(str)
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win/inspector/curl-command-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698