Home/Support/Support Forum/Incorrect handling of empty form fields.
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Incorrect handling of empty form fields.

0 votes
Summary: Incorrect handling of empty form fields when using Enctype=MULTIPART/FORM-DATA.

If contents of a form item are null, the rpHTTPD returns 400 error. For example:
Code:
-----------------------------14162188131998 Content-Disposition: form-data; name="szMailRecv4" <-- empty field -----------------------------14162188131998 Content-Disposition: form-data; name="control_type" Apply -----------------------------14162188131998-- --> HTTP/1.1 400 Bad Request Content-Length: 0 Server: ---
There is a workaround to avoid this bug:
Code:
-----------------------------47452064913186 Content-Disposition: form-data; name="szMailRecv2" test2@mail.ru -----------------------------47452064913186 Content-Disposition: form-data; name="szMailRecv3" <-- Note the space. -----------------------------47452064913186 Content-Disposition: form-data; name="control_type" Apply -----------------------------47452064913186-- --> HTTP/1.1 303 See Other Location: http://192.168.1.29/---.htm Content-Length: 0 Server: ---

Now it works normally, but it requires an additional processing by both JS and application code.
asked Aug 23, 2010 in Plug N' Play by aleppin New to the Community (1 point)
recategorized Dec 5, 2013 by tuxembb

Please log in or register to answer this question.

...