luci-base: http.uc: fix reference error of undeclared variable `err`
authorTianling Shen <cnsztl@immortalwrt.org>
Thu, 13 Apr 2023 20:45:24 +0000 (04:45 +0800)
committerHannu Nyman <hannu.nyman@iki.fi>
Fri, 14 Apr 2023 07:50:02 +0000 (10:50 +0300)
The variable `err` was used without initialized.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
modules/luci-base/ucode/http.uc

index e8982e77a0027227c9a9a32cc71a615c09903b14..579dda3cedcaaa0bd625cace3c685de6fc67a069 100644 (file)
@@ -29,7 +29,7 @@ export let HTTP_MAX_CONTENT = 1024*100;               // 100 kB maximum content size
 //  o Boolean which indicates whether the current chunk is the last one (eof)
 export function mimedecode_message_body(src, msg, file_cb) {
        let len = 0, maxlen = +msg.env.CONTENT_LENGTH;
-       let header, field, parser;
+       let err, header, field, parser;
 
        parser = multipart_parser(msg.env.CONTENT_TYPE, function(what, buffer, length) {
                if (what == parser.PART_INIT) {