Commit Graph

123 Commits

Author SHA1 Message Date
Seth Lopez fba0ca9dcd Add tests for the cookie example 2017-01-06 12:40:35 -05:00
Seth Lopez 9580d6cdfd Add tests for optional_redirect example. 2016-12-29 12:41:51 -06:00
Matt McCoy 21ddb7390f Add tests for query_params example. 2016-12-28 23:20:21 -06:00
Seth Lopez ab94e344b4 Add tests for optional_result example. 2016-12-28 21:05:15 -06:00
Sergio Benitez 55a2535896 Clean up config example. 2016-12-28 18:24:54 -06:00
Seth Lopez e650587159 Add tests for config example. 2016-12-28 18:09:19 -06:00
Sergio Benitez 3d0f7f2f80 Clarify todo example requirements. 2016-12-27 02:38:21 -06:00
Sergio Benitez 4f30afc30f Show RDP information when starting AppVeyor build. 2016-12-27 02:04:47 -06:00
Sergio Benitez 89f42a614d Properly resolve nested template names in contrib.
Fixes #42.
2016-12-24 14:03:56 -08:00
Robert 77cfe0ac02 <Li> should be <li> 2016-12-23 14:42:57 -05:00
Sergio Benitez 2cf7e2c6cd Sync testing exmaple with guide. 2016-12-23 02:39:10 -08:00
Sergio Benitez b0f1263c0e Sync pastebin example with tutorial. 2016-12-23 02:38:50 -08:00
Sergio Benitez 2dc1ba29f0 Adds tests for JSON example. Emit warning from JSON FromData.
This also includes a tiny change to the `mk-docs` script to build a
blank index at the root of the docs.
2016-12-21 22:56:58 -08:00
Sergio Benitez 123c684f62 Revert hello_person to pre-testing. 2016-12-19 01:57:13 -08:00
Sergio Benitez dd7e95b3c5 Panic on illegal, dynamic mount points. 2016-12-17 10:51:44 -08:00
Sergio Benitez f1c7d3e27c Minor code improvements via clippy. 2016-12-17 09:18:30 -08:00
Sergio Benitez 6815a56cb5 Rework Request: add lifetime to future proof, remove unsafe. 2016-12-16 03:07:23 -08:00
Sergio Benitez 368e5105a9 Return a Response from testing's dispatch_with. 2016-12-15 20:53:54 -08:00
Sergio Benitez 08f41816d1 Remove dependence from Hyper in Request/MockRequest. 2016-12-15 16:34:19 -08:00
Sergio Benitez 44f5f1998d New HTTP types: ContentType, Status. Responder/Handler/ErrorHandler changed.
This is a complete rework of `Responder`s and of the http backend in
general. This gets Rocket one step closer to HTTP library independence,
enabling many future features such as transparent async I/O, automatic
HEAD request parsing, pre/post hooks, and more.

Summary of changes:

  * `Responder::response` no longer takes in `FreshHyperResponse`.
    Instead, it returns a new `Response` type.
  * The new `Response` type now encapsulates a full HTTP response. As a
    result, `Responder`s now return it.
  * The `Handler` type now returns an `Outcome` directly.
  * The `ErrorHandler` returns a `Result`. It can no longer forward,
    which made no sense previously.
  * `Stream` accepts a chunked size parameter.
  * `StatusCode` removed in favor of new `Status` type.
  * `ContentType` significantly modified.
  * New, lightweight `Header` type that plays nicely with `Response`.
2016-12-15 00:47:31 -08:00
Sergio Benitez b72af317f1 Simplify pastebin retrieve handler. 2016-12-09 21:01:30 -08:00
Sergio Benitez 0be423a35e Updated dependency versions. 2016-12-09 20:14:49 -08:00
Sergio Benitez e0bc546e93 Add pastebin example. 2016-12-09 19:56:49 -08:00
Sergio Benitez 0ce41c0f2c Remove stale comments. 2016-11-13 18:54:49 -08:00
Sergio Benitez 2cc0251a22 Further document the Catcher type. Register a catcher in the manual example. 2016-11-05 19:31:50 +01:00
Sergio Benitez d843e8354c Use handlebars so that message is escaped in cookies example. 2016-11-04 15:33:58 +01:00
Sergio Benitez 5b8b41bcd8 Fix examples for updates Redirect API. 2016-11-03 19:09:08 +01:00
Sergio Benitez 2fec4209c9 Use FlashMessage in todo example. 2016-11-02 18:49:06 +01:00
Sergio Benitez d24d5534f4 Return a 404 when a file isn't found. 2016-11-02 17:47:00 +01:00
Sergio Benitez c98d047038 Add URI::percent_decoding helper method. Safeguard Pathbuf FromSegments implementation. 2016-11-02 16:55:56 +01:00
Sergio Benitez d91e3e0454 Add the [global] psuedo-environment for global configuration. 2016-10-31 17:00:32 +01:00
Sergio Benitez da7cb44671 Add more testing module documentation. Fix test for latest nightly. 2016-10-31 10:21:19 +01:00
Sergio Benitez 6a8d64f69b Move the data module into the top-level namespace. 2016-10-25 13:24:07 +02:00
Sergio Benitez f5a5ea3a22 Rename `data` to `content` in `response`. Remove `DataOutcome`. 2016-10-25 13:03:50 +02:00
Sergio Benitez 5447f81f77 Remove RequestOutcome, ResponseOutcome in favor of Outcome. Remove Failure response type. 2016-10-25 11:17:49 +02:00
Sergio Benitez a145a11848 Add tests to the hello_world, helllo_ranks, and hello_person examples. 2016-10-17 15:14:57 -07:00
Sergio Benitez bc5ecb31df Implement a small testing framework in the 'testing' module. 2016-10-16 03:16:16 -07:00
Sergio Benitez 1323e7a420 Add `config::get()`, for global config access. Use it for `Template`. 2016-10-14 18:57:36 -07:00
Sergio Benitez 722f613686 Use Outcome as the result of all fallible conversions. 2016-10-13 18:39:23 -07:00
Sergio Benitez b4305cb430 Use 'Content-Type' for format routing. Simplify 'raw_upload' example. 2016-10-12 19:08:19 -07:00
Sergio Benitez 4769b17d13 Use 'format' in 'raw_upload' example instead of checking Content-Type directly. 2016-10-12 16:48:32 -07:00
Sergio Benitez a9b12568d9 Update to upstream diesel. 2016-10-12 00:38:30 -07:00
Sergio Benitez 2f35b23514 Remove non-streaming requests. Use streaming requests everywhere.
This commit includes the following important API changes:

  * The `form` route parameter has been removed.
  * The `data` route parameter has been added.
  * Forms are not handled via the `data` parameter and `Form` type.
  * Removed the `data` parameter from `Request`.
  * Added `FromData` conversion trate and default implementation.
  * Added `DataOutcome` enum, which is the return type of `from_data`.
  * 'FromData' is now used to automatically derive the `data` parameter.
  * Moved `form` into `request` module.
  * Removed `Failure::new` in favor of direct value construction.

This commit includes the following important package additions:

  * Added a 'raw_upload' example.
  * `manual_routes` example uses `Data` parameter.
  * Now building and running tests with `--all-features` flag.
  * All exmaples have been updated to latest API.
  * Now using upstream Tera.

This commit includes the following important fixes:

  * Any valid ident is now allowed in single-parameter route parameters.
  * Lifetimes are now properly stripped in code generation.
  * `FromForm` derive now works on empty structs.
2016-10-12 00:14:42 -07:00
Sergio Benitez d8db812856 Implement streaming requests. 2016-10-09 04:29:02 -07:00
Sergio Benitez 216b30cb78 Remove accidentally included file. 2016-10-08 21:06:53 -07:00
Sergio Benitez 7c6dce266b Update cookies example to use contrib Template. 2016-10-08 21:02:42 -07:00
Sergio Benitez 619b1d787e Rename Response::new to complete. Add Response::failure using newly added Failure response. 2016-10-08 20:53:04 -07:00
Sergio Benitez 6275e576b5 Updates for latest nightly. Use Tera from main branch. 2016-10-08 19:27:33 -07:00
Sergio Benitez 8c0d11feab Completely new raw API.
Summary of changes:

  * Request no longer has a lifetime parameter.
  * Handler type now includes a `Data` parameter.
  * Response is now an enum that is either `Complete` or `Forward`.
  * Outcome enum is now one of: Success, Failure, Forward.
  * Outcome::Foward for Responses must include StatusCode.
  * Responders are now final: they cannot forward to requests. (!!)
  * Responsers may only forward to catchers. (!!)
  * Response no longer provides wrapping methods.
  * Route is now cloneable.

This change is fundamental to enabling streaming requests.
2016-10-07 23:20:49 -07:00
Sergio Benitez 37e6a367b8 Move the form module under request and outcome to top-level. 2016-10-07 19:27:50 -07:00