luci/libs
Daniel Dickinson b130ca554f lib-nixio / luci-base: Fix for reading csrf token prevents file upload
The call to http.formvalue in order to read the csrf token causes
_parse_input to be triggered *before* controllers and cbi maps have
been built.  This results in the failure of file uploads because
the file handler is not yet in place when _parse_input gets called,
and it is in _parse_input that POST data is parsed (including files).

To fix this we add the ability to write file fields to temporary
files (using mkstemp and unlink in nixio.file) and use this to
store file data until the filehandler is registered, with a
fallback to reading the file data into memory.

Once the filehandler callback gets registered we iterate
though all previously parsed (saved) files and copy the
data to the file handler, and then close the temporary
file (which finally removes because we unlinked after
creating the file, but didn't close the file so unlink
was deferred).

Signed-off-by: Daniel Dickinson <openwrt@daniel.thecshore.com>
2015-12-15 13:12:29 -05:00
..
luci-lib-httpclient add params support in options 2015-01-22 13:12:48 +08:00
luci-lib-ip luci-lib-ip: fix documentation issue 2015-09-01 16:49:19 +02:00
luci-lib-json Fix module lines in several luadoc files 2015-09-01 16:43:19 +02:00
luci-lib-jsonc luci-lib-jsonc: Fix memory leak in stringify() 2015-08-31 19:53:51 +02:00
luci-lib-luaneightbl luci-lib-luaneightbl: add src Makefile and fix dependencies (#282) 2015-01-09 13:04:01 +01:00
luci-lib-nixio lib-nixio / luci-base: Fix for reading csrf token prevents file upload 2015-12-15 13:12:29 -05:00
luci-lib-px5g luci-lib-px5g: disable MIPS16 2015-01-15 11:12:11 +01:00
luci-lib-rpcc Fix module lines in several luadoc files 2015-09-01 16:43:19 +02:00