mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-10-29 17:54:14 +08:00
handle_post() takes the request path from byte 6 of the segment it is given. For the first segment of a POST that is the path, but for a later segment of a multipart upload it is whatever part of the file happens to sit there. The cmd and login handlers were matched before the multipart state was checked, so a segment of a config or firmware upload with "cmd " at that offset ran the rest of the segment as CLI commands, and one with "login " there aborted the upload with 400. Check for an upload in progress, and for new upload and config requests, before looking at cmd and login. A new POST cannot match both sets of words, so nothing changes for requests that are not uploads.