Bug 1986142 - Fix lint warnings. a=me DONTBUILD

This commit is contained in:
Ryan VanderMeulen
2025-10-01 20:27:20 -04:00
committed by rvandermeulen@mozilla.com
parent c8e6b3801c
commit 0af041b429
2 changed files with 11 additions and 11 deletions

View File

@@ -208,19 +208,19 @@ function testRemoveBinaryDataFromMultipartText(data) {
const EXPECTED_WIN_RESULT = [ const EXPECTED_WIN_RESULT = [
'^"', '^"',
boundary, boundary,
'^\u000A\u000A', "^\u000A\u000A",
'Content-Disposition: form-data; name=^\\^"param1^\\^"', 'Content-Disposition: form-data; name=^\\^"param1^\\^"',
'^\u000A\u000A^\u000A\u000A', "^\u000A\u000A^\u000A\u000A",
"value1", "value1",
'^\u000A\u000A', "^\u000A\u000A",
boundary, boundary,
'^\u000A\u000A', "^\u000A\u000A",
'Content-Disposition: form-data; name=^\\^"file^\\^"; filename=^\\^"filename.png^\\^"', 'Content-Disposition: form-data; name=^\\^"file^\\^"; filename=^\\^"filename.png^\\^"',
'^\u000A\u000A', "^\u000A\u000A",
"Content-Type: image/png", "Content-Type: image/png",
'^\u000A\u000A^\u000A\u000A', "^\u000A\u000A^\u000A\u000A",
boundary + "--", boundary + "--",
'^\u000A\u000A', "^\u000A\u000A",
'^"', '^"',
].join(""); ].join("");

View File

@@ -474,10 +474,10 @@ const CurlUtils = {
// by the previous replace. // by the previous replace.
.replace(/%(?=[a-zA-Z0-9_])/g, "%^") .replace(/%(?=[a-zA-Z0-9_])/g, "%^")
// Lastly we replace new lines with ^ and TWO new lines because the first // 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 // new line is there to enact the escape command the second is the character
// to escape (in this case new line). // to escape (in this case new line).
.replace(/\r?\n|\r/g, '^\n\n') + .replace(/\r?\n|\r/g, "^\n\n") +
encapsChars encapsChars
); );
}, },