File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,8 @@ void HTMLFormElement::submit(RefPtr<HTMLInputElement> submitter)
50
50
}
51
51
52
52
auto effective_method = method ().to_lowercase ();
53
- if (effective_method != " get" ) {
54
- if (effective_method == " post " || effective_method == " dialog" ) {
53
+ if (effective_method != " get" && effective_method != " post " ) {
54
+ if (effective_method == " dialog" ) {
55
55
dbg () << " Unsupported form method '" << method () << " '" ;
56
56
return ;
57
57
}
@@ -69,10 +69,24 @@ void HTMLFormElement::submit(RefPtr<HTMLInputElement> submitter)
69
69
return IterationDecision::Continue;
70
70
});
71
71
72
- url.set_query (urlencode (parameters));
72
+ if (effective_method == " get" ) {
73
+ url.set_query (urlencode (parameters));
74
+ }
73
75
74
76
// FIXME: We shouldn't let the form just do this willy-nilly.
75
- document ().frame ()->page ().load (url);
77
+
78
+ LoadRequest request;
79
+ request.set_url (url);
80
+
81
+ if (effective_method == " post" ) {
82
+ auto body = urlencode (parameters).to_byte_buffer ();
83
+ request.set_method (" POST" );
84
+ request.set_header (" Content-Type" , " application/x-www-form-urlencoded" );
85
+ request.set_header (" Content-Length" , String::number (body.size ()));
86
+ request.set_body (body);
87
+ }
88
+
89
+ document ().frame ()->page ().load (request);
76
90
}
77
91
78
92
}
You can’t perform that action at this time.
0 commit comments