summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/ucode/http.uc
AgeCommit message (Collapse)Author
2023-08-21luci-base: http.uc: fix eof detection in temporary upload filesJo-Philipp Wich
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>
2023-04-14luci-base: http.uc: fix reference error of undeclared variable `err`Tianling Shen
The variable `err` was used without initialized. Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-11-03luci-base: fix luci.http.close()Jo-Philipp Wich
Ensure that `http.write()` or template rendering operations after a call to `http.close()` do not produce additional output. This is required for certain legacy Lua apps which invoke write and close operations in the middle of a server side cbi rendering process. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-11-02luci-base: http.uc: fix invoking Lua file upload callbacksJo-Philipp Wich
In case a callback is installed from Lua code, the received callback argument is not a callable function but a resource object with a call method. Attempts to call it will leading to a `Type error: left-hand side is not a function` error. To solve this issue, invoke the internally set filehandler instead which wraps the resource if needed. Fixes: #6067 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-10-25treewide: separate Lua runtime resourcesJo-Philipp Wich
Move classes required for Lua runtime support into a new `luci-lua-runtime` package. Also replace the `luci.http` and `luci.util` classes in `luci-lib-base` with stubbed versions interacting with the ucode based runtime environment. Finally merge `luci-base-ucode` into the remainders of `luci-base`. Signed-off-by: Jo-Philipp Wich <jo@mein.io>