luci-base: http.uc: fix eof detection in temporary upload files

Binary string comparisons in ucode are currently unsafe, so use the
`length()` function to determine the just read data chunk size in
order to test for end of file.

Fixes: #6530
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2023-08-21 16:37:11 +02:00
parent 18b637fed9
commit b4594b3d11

View file

@ -430,7 +430,7 @@ const Class = {
for (let name, value in this.message.params) { for (let name, value in this.message.params) {
while (value?.fd) { while (value?.fd) {
let data = value.fd.read(1024); let data = value.fd.read(1024);
let eof = (data == null || data == ''); let eof = (length(data) == 0);
this.filehandler(value, data, eof); this.filehandler(value, data, eof);