browser(firefox): fast post body conversion to base64 (#12898)
This commit is contained in:
Родитель
85b01056b6
Коммит
96b0a4b993
|
@ -1,2 +1,2 @@
|
|||
1318
|
||||
Changed: lushnikov@chromium.org Mon 28 Feb 2022 06:54:27 PM PST
|
||||
1319
|
||||
Changed: yurys@chromium.org Fri 18 Mar 2022 05:39:20 PM PDT
|
||||
|
|
|
@ -754,16 +754,11 @@ function readRequestPostData(httpChannel) {
|
|||
}
|
||||
|
||||
// Read data from the stream.
|
||||
let result = undefined;
|
||||
let result = '';
|
||||
try {
|
||||
const buffer = NetUtil.readInputStream(iStream, iStream.available());
|
||||
const bytes = new Uint8Array(buffer);
|
||||
let binary = '';
|
||||
for (let i = 0; i < bytes.byteLength; i++)
|
||||
binary += String.fromCharCode(bytes[i]);
|
||||
result = btoa(binary);
|
||||
const buffer = NetUtil.readInputStreamToString(iStream, iStream.available());
|
||||
result = btoa(buffer);
|
||||
} catch (err) {
|
||||
result = '';
|
||||
}
|
||||
|
||||
// Seek locks the file, so seek to the beginning only if necko hasn't
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
1319
|
||||
Changed: lushnikov@chromium.org Mon Mar 7 16:04:44 PST 2022
|
||||
1320
|
||||
Changed: yurys@chromium.org Fri 18 Mar 2022 05:34:13 PM PDT
|
||||
|
|
|
@ -754,16 +754,11 @@ function readRequestPostData(httpChannel) {
|
|||
}
|
||||
|
||||
// Read data from the stream.
|
||||
let result = undefined;
|
||||
let result = '';
|
||||
try {
|
||||
const buffer = NetUtil.readInputStream(iStream, iStream.available());
|
||||
const bytes = new Uint8Array(buffer);
|
||||
let binary = '';
|
||||
for (let i = 0; i < bytes.byteLength; i++)
|
||||
binary += String.fromCharCode(bytes[i]);
|
||||
result = btoa(binary);
|
||||
const buffer = NetUtil.readInputStreamToString(iStream, iStream.available());
|
||||
result = btoa(buffer);
|
||||
} catch (err) {
|
||||
result = '';
|
||||
}
|
||||
|
||||
// Seek locks the file, so seek to the beginning only if necko hasn't
|
||||
|
|
Загрузка…
Ссылка в новой задаче