browser(firefox): do not send post data > 10Mb to the client (#12969)
This commit is contained in:
Родитель
ab39cfcb18
Коммит
463b4b1c0d
|
@ -1,2 +1,2 @@
|
|||
1319
|
||||
Changed: yurys@chromium.org Fri 18 Mar 2022 05:39:20 PM PDT
|
||||
1320
|
||||
Changed: yurys@chromium.org Tue 22 Mar 2022 05:26:17 PM PDT
|
||||
|
|
|
@ -754,10 +754,14 @@ function readRequestPostData(httpChannel) {
|
|||
}
|
||||
|
||||
// Read data from the stream.
|
||||
let result = '';
|
||||
let result = undefined;
|
||||
try {
|
||||
const buffer = NetUtil.readInputStreamToString(iStream, iStream.available());
|
||||
result = btoa(buffer);
|
||||
const maxLen = iStream.available();
|
||||
// Cap at 10Mb.
|
||||
if (maxLen <= 10 * 1024 * 1024) {
|
||||
const buffer = NetUtil.readInputStreamToString(iStream, maxLen);
|
||||
result = btoa(buffer);
|
||||
}
|
||||
} catch (err) {
|
||||
}
|
||||
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
1320
|
||||
Changed: yurys@chromium.org Fri 18 Mar 2022 05:34:13 PM PDT
|
||||
1321
|
||||
Changed: yurys@chromium.org Tue 22 Mar 2022 05:24:48 PM PDT
|
||||
|
|
|
@ -754,10 +754,14 @@ function readRequestPostData(httpChannel) {
|
|||
}
|
||||
|
||||
// Read data from the stream.
|
||||
let result = '';
|
||||
let result = undefined;
|
||||
try {
|
||||
const buffer = NetUtil.readInputStreamToString(iStream, iStream.available());
|
||||
result = btoa(buffer);
|
||||
const maxLen = iStream.available();
|
||||
// Cap at 10Mb.
|
||||
if (maxLen <= 10 * 1024 * 1024) {
|
||||
const buffer = NetUtil.readInputStreamToString(iStream, maxLen);
|
||||
result = btoa(buffer);
|
||||
}
|
||||
} catch (err) {
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче