mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
httpd: Added extra content_type check for login.
Ensure login content_type is "application/x-www-form-urlencoded".
This commit is contained in:
@@ -442,6 +442,13 @@ void handle_post(void)
|
||||
cmd_available = 1;
|
||||
} else if (is_word(request_path, "login")) {
|
||||
dbg_string("POST login\n");
|
||||
|
||||
if (!content_type || !is_word(content_type, "application/x-www-form-urlencoded")) {
|
||||
dbg_string("Bad request!\n");
|
||||
send_bad_request();
|
||||
return;
|
||||
}
|
||||
|
||||
p += 8; // Read also over "pwd="
|
||||
if (is_url_word_x(p, passwd)) {
|
||||
dbg_string("Password accepted!\n");
|
||||
|
||||
Reference in New Issue
Block a user