1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 19:55:06 +00:00

LibWeb: Improve <form> submit method handling

The spec defines the only valid methods to be get, post, and dialog.
Post and dialog are currently unhandled and do nothing, any other value
(or no value specified) is defined by the spec to use the get method.
This commit is contained in:
Shadowfacts 2020-05-04 18:22:40 -04:00 committed by Andreas Kling
parent 72d2bd56ce
commit 4d5dc5950a

View file

@ -48,9 +48,13 @@ void HTMLFormElement::submit()
return;
}
if (method().to_lowercase() != "get") {
dbg() << "Unsupported form method '" << method() << "'";
return;
auto effective_method = method().to_lowercase();
if (effective_method != "get") {
if (effective_method == "post" || effective_method == "dialog") {
dbg() << "Unsupported form method '" << method() << "'";
return;
}
effective_method = "get";
}
URL url(document().complete_url(action()));