Rocket/codegen/tests/run-pass
Sergio Benitez ed429cd487 Change FromForm signature. Emit 422 form errors on bad form strings.
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.
2017-02-01 18:22:51 -08:00
..
complete-decorator.rs URI uses Cow iternally. 2016-12-21 00:09:22 -08:00
custom-content-type.rs Warn, but don't error, on unknown route formats. 2016-12-27 15:30:33 -06:00
derive_form.rs Change FromForm signature. Emit 422 form errors on bad form strings. 2017-02-01 18:22:51 -08:00
dynamic-paths.rs Add more codegen tests. 2016-09-28 20:39:14 -07:00
empty-fn.rs Allow head decorator and options via route decorator. 2016-12-30 01:41:46 -06:00
empty_form.rs Change FromForm signature. Emit 422 form errors on bad form strings. 2017-02-01 18:22:51 -08:00
error-handler.rs Completely new raw API. 2016-10-07 23:20:49 -07:00
instanced-mounting.rs Improve lints: gather info on per-instance basis. 2017-01-31 02:01:30 -08:00
issue-1-colliding-names.rs Renamed macros to codegen. 2016-09-08 20:38:58 -07:00
methods.rs Test methods via route attribute. 2016-12-30 01:46:47 -06:00
rank_decorator.rs Allow different lifetimes in handler Request reference and its contents. 2016-10-06 20:38:13 -07:00
segments.rs Fix security checks in `PathBuf::FromSegments`. 2017-01-13 13:25:33 -08:00