luci-base: dispatcher.uc: only flush HTTP headers after rendering output
authorJo-Philipp Wich <[email protected]>
Thu, 3 Nov 2022 10:13:30 +0000 (11:13 +0100)
committerJo-Philipp Wich <[email protected]>
Thu, 3 Nov 2022 10:17:55 +0000 (11:17 +0100)
commit4b1a074c95a674f2da154ee627e053db550cdd9d
tree70dba689922c873c2e956f73978d2c1a5eb7980a
parent86523709ef65da8a6d029b2ec401a8db30cefcdf
luci-base: dispatcher.uc: only flush HTTP headers after rendering output

Ensure to first completely render the action function before flushing HTTP
headers since the invoked action logic might modify the HTTP headers itself.

Fixes: e7afd0d327 ("luci-base: fix luci.http.close()")
Ref: https://github.com/openwrt/luci/commit/e7afd0d327bb35c502ca41a3c5e3ea098898fbd7#commitcomment-88736854
Signed-off-by: Jo-Philipp Wich <[email protected]>
modules/luci-base/ucode/dispatcher.uc