You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think I found an issue in the web server included in CircuitPython. If you post a form back to the web server that has no input fields, OR contains only chekboxes and they all are clear (which causes no form data to be posted back), the web server seems to crash.
When the checkbox is clear, and the form is posted back, when trying to access the field value (or any of the other relevant methods like get(...)):
@server.route("/update", POST)
def update(request: Request):
x = request.form_data.fields
The web server crashes with this error:
File "adafruit_httpserver/request.py", line 321, in form_data
File "adafruit_httpserver/request.py", line 144, in __init__
File "adafruit_httpserver/request.py", line 157, in _parse_x_www_form_urlencoded
ValueError: need more than 1 values to unpack
This is using adafruit_httpserver from adafruit-circuitpython-bundle-8.x-mpy-20230829.zip on a Rasberry PI Pico on Circuit Python 8.2.4
If I add a text or hidden input in the form for example, it works:
Hi,
I think I found an issue in the web server included in CircuitPython. If you post a form back to the web server that has no input fields, OR contains only chekboxes and they all are clear (which causes no form data to be posted back), the web server seems to crash.
For example this form:
When the checkbox is clear, and the form is posted back, when trying to access the field value (or any of the other relevant methods like get(...)):
The web server crashes with this error:
This is using adafruit_httpserver from adafruit-circuitpython-bundle-8.x-mpy-20230829.zip on a Rasberry PI Pico on Circuit Python 8.2.4
If I add a text or hidden input in the form for example, it works:
The text was updated successfully, but these errors were encountered: