Issue #1028 resolved

_cpreqbody.process_multipart_form_data discards duplicate request parameters

Anonymous created an issue

CherryPy handles multiple request parameters with the same name by putting them in a list. So if I visit http://example.com/index?foo=bar then the "foo" parameter will be the string "bar", but if I visit http://example.com/index?foo=bar&foo=bax then the "foo" parameter will be the list ["bar", "baz"]

Until CherryPy 3.2, multipart/form-data requests behaved the same way. Unfortunately, the release candidate fails to do this, and instead uses the last value in the request body for each parameter. I will attach a test program which demonstrates this behavior, then submit a patch later this afternoon.

Reported by Eli Courtwright eli@courtwright.org

Comments (5)

  1. guest

    Just stumbled over this problem when testing !TurboGears 1.5 with !CherryPy 3.2.0rc1. Took me some time to realize it was a !CherryPy issue and not a problem of !TurboGears parameter handling and validation. I have added a failing unit test to TG 1.5 and can confirm that it passes with the patch above. Please fix this before releasing 3.2 final. -- Christoph Zwerschke

  2. Log in to comment