Commit 89e60cc4 authored by Kyle J. McKay's avatar Kyle J. McKay

form.c: do not gratuitously turn GET into POST

When encountering a <form ...> tag that contains these values:

    method="get" enctype="multipart/form-data"

Do not transform the method into POST to accomodate enctype.

Instead behave in the compatible way that all other browsers
behave in this instance and ignore the enctype parameter
(treating it as the default application/x-www-form-urlencoded)
and perform a "GET" just as the method parameter requests.

This behavior produces far more compatible results than
gratuitously changing the "get" into a "post" which can
result in unexpected "405 Method Not Allowed" errors.
Signed-off-by: 's avatarKyle J. McKay <mackyle@gmail.com>
parent d398b403
......@@ -56,10 +56,9 @@ newFormList(char *action, char *method, char *charset, char *enctype,
m = FORM_METHOD_INTERNAL;
/* unknown method is regarded as 'get' */
if (enctype != NULL && !strcasecmp(enctype, "multipart/form-data")) {
if (m != FORM_METHOD_GET && enctype != NULL &&
!strcasecmp(enctype, "multipart/form-data")) {
e = FORM_ENCTYPE_MULTIPART;
if (m == FORM_METHOD_GET)
m = FORM_METHOD_POST;
}
#ifdef USE_M17N
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment