mirror of https://github.com/rwf2/Rocket.git
ed429cd487
This commit changes the way Rocket parses form items. In particular, it now (liberally) validates form strings, returning a Bad Request on malformed inputs and Unprocessable Entity on bad parses. The 'FormItems' iterator was modified to accomodate this. The iterator is now initialized using 'from': 'FormItems::from(form_string)'. The iterator can be queried to check for a complete parse using either 'completed()' or 'exhausted()', the latter of which will consume valid keys/values and return true only if the entire string was consumed. The 'FromForm' trait now takes a mutable borrow to a 'FormItems' iterator. The 'Form' and 'FormForm' implementation for 'Form' were modified to use the new iterfaces and check for 'exhausted' after a parse, returning a Bad Request error if the iterator cannot be exhausted. Resolves #46. |
||
---|---|---|
.. | ||
compile-fail | ||
run-pass | ||
tests.rs |