From 0af041b4294af6e40caa47eb2f9b8a1f825ad892 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Wed, 1 Oct 2025 20:27:20 -0400 Subject: [PATCH] Bug 1986142 - Fix lint warnings. a=me DONTBUILD --- .../netmonitor/test/browser_net_curl-utils.js | 14 +++++++------- devtools/client/shared/curl.js | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/devtools/client/netmonitor/test/browser_net_curl-utils.js b/devtools/client/netmonitor/test/browser_net_curl-utils.js index 71ec0188ea29..cb8df325dffa 100644 --- a/devtools/client/netmonitor/test/browser_net_curl-utils.js +++ b/devtools/client/netmonitor/test/browser_net_curl-utils.js @@ -208,19 +208,19 @@ function testRemoveBinaryDataFromMultipartText(data) { const EXPECTED_WIN_RESULT = [ '^"', boundary, - '^\u000A\u000A', + "^\u000A\u000A", 'Content-Disposition: form-data; name=^\\^"param1^\\^"', - '^\u000A\u000A^\u000A\u000A', + "^\u000A\u000A^\u000A\u000A", "value1", - '^\u000A\u000A', + "^\u000A\u000A", boundary, - '^\u000A\u000A', + "^\u000A\u000A", 'Content-Disposition: form-data; name=^\\^"file^\\^"; filename=^\\^"filename.png^\\^"', - '^\u000A\u000A', + "^\u000A\u000A", "Content-Type: image/png", - '^\u000A\u000A^\u000A\u000A', + "^\u000A\u000A^\u000A\u000A", boundary + "--", - '^\u000A\u000A', + "^\u000A\u000A", '^"', ].join(""); diff --git a/devtools/client/shared/curl.js b/devtools/client/shared/curl.js index c23c6ab227ea..e3894da81231 100644 --- a/devtools/client/shared/curl.js +++ b/devtools/client/shared/curl.js @@ -474,10 +474,10 @@ const CurlUtils = { // by the previous replace. .replace(/%(?=[a-zA-Z0-9_])/g, "%^") - // Lastly we replace new lines with ^ and TWO new lines because the first - // new line is there to enact the escape command the second is the character - // to escape (in this case new line). - .replace(/\r?\n|\r/g, '^\n\n') + + // Lastly we replace new lines with ^ and TWO new lines because the first + // new line is there to enact the escape command the second is the character + // to escape (in this case new line). + .replace(/\r?\n|\r/g, "^\n\n") + encapsChars ); },