Commit Graph

289 Commits

Author SHA1 Message Date
arlecchino 1ba41b3990 Remove 'CookieJar::get_private_pending()'.
This commit removes the 'CookieJar::get_private_pending()' method in
favor of the already existing and correct 'CookieJar::get_pending()'
method. Previously, the 'CookieJar::get_private_pending()' method
attempted to decrypt the value of a pending cookie, which in reality is
plaintext, thus failing. Because the pending value is plaintext, the
'CookieJar::get_pending()' method suffices.

Documentation has been updated to refer to 'CookieJar::get_pending()'.

Fixes #2063.
2022-02-17 11:04:30 -08:00
Johannes Liebermann 815e8a242f Fix typo in guide overview. 2021-09-07 12:02:56 -07:00
Sergio Benitez f38cbea898 Clean up upgrade guide, FAQ. Mention FAQ more. 2021-08-29 16:55:07 -07:00
Sergio Benitez 010e762125 Fix markdown word wrap. 2021-08-24 20:13:13 -07:00
hiyoko3m 5c928488ee Add missing ']' in forms guide. 2021-08-24 20:13:13 -07:00
Sergio Benitez a361bbd899 Add 0.5 migration guide, FAQ to site docs. 2021-08-19 19:49:23 -07:00
Jeremy Kaplan 26ca47b03d Fix typo in requests guide: 'Synax' -> 'Syntax'. 2021-08-01 11:47:09 -07:00
Silas Sewell 31d06ee714 Fix 'ROCKET_CLI_COLORS' example in getting started guide: 'off' -> 'false'. 2021-07-24 15:15:43 -07:00
JR Heard 3b9fd56d4c Fix typo in fairings guide: missing 'of the'. 2021-07-24 14:55:50 -07:00
Sergio Benitez cc0621626b Prefix 'content' responder names with 'Raw'.
The primary aim of this commit is to reduce confusion between
'content::Json' and 'rocket::serde::json::Json' be renaming the former
to 'content::RawJson'. The complete changes in this PR are:

  * All responders in the 'content' module are prefixed with 'Raw'.
  * The 'content::Custom' responder was removed entirely.
  * The 'Plain' responder is now 'RawText'.
  * The 'content' API docs point to the 'serde' responders.
  * The docs and examples were updated accordingly.
2021-07-20 02:09:11 -07:00
Sergio Benitez 7ffe3a7360 Complete mTLS implementation.
Resolves #254.
2021-07-09 00:05:44 -07:00
Sergio Benitez 416f42bca7 Fix header level of "Within Guards" in guide.
Resolves #1737.
2021-06-30 21:02:28 -07:00
multisn8 8f9d7e6374 Fix guide typo: "deserialzies" -> "deserializes". 2021-06-30 11:08:51 -07:00
Ian Jackson 42f84f0621 Update IRC links to Libera (irc.libera.chat). 2021-06-30 11:04:54 -07:00
Martinez 2bd5cefedd Check response status in guide form tests. 2021-06-30 11:01:32 -07:00
Sergio Benitez dc1b729f29 Don't ignore 'launch()' result in guide overview. 2021-06-30 10:19:36 -07:00
Flying-Toast 8e3ad40beb Add 'context!' for ad-hoc templating contexts. 2021-06-30 10:09:28 -07:00
Sergio Benitez f818702f9b Propagate TLS ciphersuite config to rustls.
Closes #1563.
2021-06-29 11:17:59 -07:00
Sergio Benitez dd722cdcfc Add configurable TLS ciphersuite preferences. 2021-06-29 10:35:55 -07:00
Sergio Benitez c2e457c00f Add "Wrapping Validators" section to forms guide. 2021-06-29 03:37:52 -07:00
Sergio Benitez dcbb1941c5 Explicitly mention multipart support in guide. 2021-06-29 03:33:44 -07:00
Sergio Benitez ca9e3da5b6 Improve text on site index page. 2021-06-26 17:11:56 -07:00
Paul van Tilburg c1b14084f9 Fix a few minor mistakes in the guide. 2021-06-17 17:21:58 -07:00
Vasili f54d913bd3 Fix typo in configuration guide: 'it's' -> 'its'. 2021-06-14 19:36:03 -07:00
Roger Mo 9dc70936a2 Fix typos in fairings guide: 'are are', 'build' -> 'built'. 2021-06-14 19:36:03 -07:00
Yohannes Kifle b4bfc9f249 Fix typo in requests guide: 'the' -> 'then'. 2021-06-14 19:36:03 -07:00
Thomas Eckert 7cced84c3f Fix link to the JSON example in the requests guide. 2021-06-14 19:36:03 -07:00
Paul Smith 7b757b2d23 Clarify explanation of reinterpreted request methods in the requests guide. 2021-06-14 19:36:03 -07:00
Thibaud Martinez 7fa496f9f8 Fix typo in guide: 'mechnisms' -> 'mechanisms'. 2021-06-14 19:36:03 -07:00
Sergio Benitez ecde703bb9 Add news article for v0.5-rc.1. 2021-06-09 09:52:37 -07:00
Sergio Benitez c028d63e5b New version: 0.5.0-rc.1.
New contrib versions: 0.1.0-rc.1.
2021-06-09 09:52:37 -07:00
Sergio Benitez fe16d11581 Update 'release' date for master. 2021-06-09 04:51:46 -07:00
Sergio Benitez 01436d2d24 Fix a ton of broken links. 2021-06-09 04:51:46 -07:00
Sergio Benitez 128234d9a8 Allow customizing and removing 'Server' header. 2021-06-08 23:09:57 -07:00
Sergio Benitez 4c6562cd29 Drop 'Data' after sending a response, not before.
This allows responses to be sent to the client even when data is only
partially read, significantly improving the experience for the client
from one with a "connection closed" error to one with a proper response.
The consequence is a lifetime in 'Data'.

Though other non-lifetime-introducing solutions exist, the introduction
of a lifetime to 'Data' is a longstanding desire as it prevents
smuggling 'Data' into a longer-lived context. Use of 'Data' in that
context was unspecified with various runtime consequences. The addition
of a lifetime bound by the request prevents this error statically.

In summary, the changes are:
  * Clients receive responses even when data isn't fully read.
  * 'Data' becomes 'Data<'r>'. 'FromData' changes accordingly.
  * Route 'Outcome's are strictly tied to the request lifetime.

Tangentially, the invalid length form field validation error message has
improved to format length in byte units if it exceeds 1024.
2021-06-08 13:26:16 -07:00
Sergio Benitez 0aa9a11ca4 Fix typos throughout codebase. 2021-06-07 19:31:21 -07:00
Sergio Benitez cad5494d42 Document ignored segments. 2021-06-07 17:22:35 -07:00
Sergio Benitez 1e4db983e8 Fix, finish 'FromForm' derive field defaults.
Resolves #1536.
2021-06-03 00:05:02 -07:00
ThouCheese ebb9f3cfdd Allow field defaults in 'FromForm' derive. 2021-06-03 00:02:32 -07:00
Sergio Benitez 9f5a587dc3 Add more examples to wrapping responders guide.
Co-authored-by: RotesWasser <hallo@roteswasser.com>
2021-06-02 18:04:15 -07:00
Sergio Benitez 5a4e66ec43 Split 'rocket_contrib' into distinct crates.
This follows the completed graduation of stable contrib features into
core, removing 'rocket_contrib' in its entirety in favor of two new
crates. These crates are versioned independently of Rocket's core
libraries, allowing upgrades to dependencies without consideration for
versions in core libraries.

'rocket_dyn_templates' replaces the contrib 'templates' features. While
largely a 1-to-1 copy, it makes the following changes:

  * the 'tera_templates' feature is now 'tera'
  * the 'handlebars_templates' feature is now 'handlebars'
  * fails to compile if neither 'tera' nor 'handlebars' is enabled

'rocket_sync_db_pools' replaces the contrib 'database' features. It
makes no changes to the replaced features except that the `database`
attribute is properly documented at the crate root.
2021-05-24 22:57:51 -07:00
Sergio Benitez 8a9000a9cb Document the 'Contextual' form guard. 2021-05-23 18:09:43 -07:00
Sergio Benitez ab13d73b30 Prefer using 'io::Result' responder in docs. 2021-05-22 22:12:46 -07:00
Sergio Benitez 57f27730e7 Fix link to 'Multitasking' in state guide.
Co-authored-by: Stuart Hinson <stuart.hinson@gmail.com>
2021-05-22 22:07:57 -07:00
Sergio Benitez a26f93c572 Fix references to removed 'hello_world' example. 2021-05-22 16:43:21 -07:00
Sergio Benitez a13a2f4a84 Move 'FileName', 'TempFile', 'NamedFile' to 'fs'.
This consolidates all file system related types into one module.
2021-05-22 16:22:01 -07:00
Sergio Benitez b1d05d20ac Graduate 'serve' into core as 'fs', 'FileServer'.
This completes the graduation of stable 'contrib' features to 'core'.

Closes #1107.
2021-05-22 11:15:56 -07:00
Sergio Benitez 267cb9396f Introduce 'Singleton' fairings.
A singleton fairing is guaranteed to be the only instance of its type at
launch time. If more than one instance of a singleton fairing is
attached, only the last instance is retained.
2021-05-22 11:01:00 -07:00
Sergio Benitez c74bcfd40a Graduate contrib 'json' and 'msgpack' into core.
This has the following nice benefits:

  * The 'JsonValue' wrapper type is gone.
  * 'Local{Request, Response}' natively support JSON/MessagePack.
  * The 'json' and 'msgpack' limits are officially recognized.
  * Soon, Rocket application will not require an explicit 'serde' dep.

This marks the beginning of the end of 'rocket_contrib'.
2021-05-22 11:01:00 -07:00
Sergio Benitez fa3e0334c1 Overhaul URI types, parsers, 'uri!' macro.
This commit entirely rewrites Rocket's URI parsing routines and
overhauls the 'uri!' macro resolving all known issues and removing any
potential limitations for compile-time URI creation. This commit:

  * Introduces a new 'Reference' URI variant for URI-references.
  * Modifies 'Redirect' to accept 'TryFrom<Reference>'.
  * Introduces a new 'Asterisk' URI variant for parity.
  * Allows creation of any URI type from a string literal via 'uri!'.
  * Enables dynamic/static prefixing/suffixing of route URIs in 'uri!'.
  * Unifies 'Segments' and 'QuerySegments' into one generic 'Segments'.
  * Consolidates URI formatting types/traits into a 'uri::fmt' module.
  * Makes APIs more symmetric across URI types.

It also includes the following less-relevant changes:

  * Implements 'FromParam' for a single-segment 'PathBuf'.
  * Adds 'FileName::is_safe()'.
  * No longer reparses upstream request URIs.

Resolves #842.
Resolves #853.
Resolves #998.
2021-05-19 18:47:11 -07:00