Commit Graph

2419 Commits

Author SHA1 Message Date
Sergio Benitez 915c1181da Forward whole-form errors in 'FromForm' derive.
Resolves #2672.
2024-01-17 12:15:01 -08:00
Sergio Benitez de6a4c50ec Clarify route ranking in requests guide.
Closes #2687.
2024-01-17 10:52:00 -08:00
Sergio Benitez b3abc760ae Introduce chainable data transformers.
Resolves #775.
2023-12-27 20:02:14 -08:00
Sergio Benitez a285625f80 Upgrade 'smallvec' to simplify 'Accept' impl. 2023-12-23 23:34:23 -08:00
Sergio Benitez 3e33cfe37c Remove custom 'docify!' macro: use '#[doc]`. 2023-12-22 23:42:55 -08:00
Paul Lietar 67ad8316dc Ensure 'TempFile' flushes when persisted.
Tokio's `File::write_all()` method has an unexpected quirk: it doesn't
actually write all the requested content to the file when the returned
future resolves. Instead, the write is attempted and queued. This means
that the `persist()` method can resolve without the data being persisted
to the file system. Subsequent reads of the ostensibly written-to file
can thus fail to contain the expected data.

An call to `flush()` following `write_all()` would circumvent the issue.
Alternatively, calling `fs::write()` actually writes to the file system
before returning and requires fewer lines of code. This commit thus
swaps the call to `write_all()` with `fs::write()`.
2023-12-19 16:01:00 -08:00
Martyn ae7e0040e8 Document "reconnect ad-infinitum" SSE pitfall. 2023-12-19 14:41:28 -08:00
Failpark 3690412aba Fix fairing naming in database MySQL example. 2023-12-19 14:33:40 -08:00
Sergio Benitez 7cf8b1368f Doc, fix, and test 'cli_colors' deserialization. 2023-12-18 16:37:56 -08:00
Lev Kokotov f4e8987a46 Make 'cli_colors' an enum, add "always" option.
Resolves #2649.
2023-12-18 16:34:13 -08:00
Mathew Horner 1b089bdb63 Fix git repository URLs in contrib crates. 2023-12-18 15:44:00 -08:00
cui fliter 485c490b1f Fix typos: 'preceeding', 'occured'. 2023-12-18 15:39:09 -08:00
Sergio Benitez b5278de795 Update 'deadpool' to 0.10.
Also updates:

  * 'deadpool-postgres'  to 0.12
  * 'deadpool-redis'  to 0.14
2023-12-15 17:23:24 -08:00
Sergio Benitez 634ba40d38 Update 'tungstenite' to '0.21'. 2023-12-15 16:58:00 -08:00
Sergio Benitez 9c2b74b23c Upgrade 'rustls' to '0.22'.
In the process, the following improvements were also made:

  * Error messages related to TLS were improved.
  * 'Redirector' in 'tls' example was improved.
2023-12-15 16:50:08 -08:00
Sergio Benitez a59f3c4c1f Fix min dependency versions. Update MSRV to 1.64.
Also includes a work-around for a buggy `format_args!` macro found in
rustc 1.67 and 1.68.

Resolves #2670.
2023-12-13 17:49:05 -08:00
Sergio Benitez 92a2559a9a Set 'img' width, height to decrease layout jitter. 2023-12-08 13:59:21 -08:00
Sergio Benitez bae8216cd4 Enable templateless issue creation. 2023-12-06 16:49:39 -08:00
Sergio Benitez 93591a87a3 Upgrade to GitHub issue forms. 2023-12-06 16:48:02 -08:00
Sergio Benitez 8d9dfcecad Silence more warnings in generated code.
Resolves #2655.
2023-12-05 17:55:56 -08:00
Sergio Benitez 7f7d352e45 Add '.rustfmt.toml' disabling formatting. 2023-11-28 10:22:22 +01:00
Sergio Benitez 2b8d6d3f06 Update data for site refresh. 2023-11-27 15:01:44 +01:00
Sergio Benitez e526fa04d4 Update 'SergioBenitez/Rocket' to 'rwf2/Rocket'.
Resolves rwf2/rwf2#5.
2023-11-21 16:32:25 +01:00
Sergio Benitez e81f6c8323 Set prelease config setting to true. 2023-11-21 16:27:04 +01:00
Sergio Benitez 9a04cff9c0
Add GitHub FUNDING file. 2023-11-21 07:21:19 -08:00
Sergio Benitez 89a2af179b Use versioned URIs in news articles. 2023-11-18 11:45:35 +01:00
Sergio Benitez 99849bd563 Add placeholder v0.5 to v0.6 upgrade guide. 2023-11-18 11:45:23 +01:00
Sergio Benitez 44ac3f1eb6 Move to 0.6.0-dev on master. 2023-11-18 11:30:50 +01:00
Sergio Benitez aabf856de4 Fix various typos in v0.5 news and guide. 2023-11-18 11:03:44 +01:00
Sergio Benitez c6d7016146 New version: 0.5.0. 2023-11-18 11:03:40 +01:00
Sergio Benitez b70c237461 Polish news for v0.5. Add RWF2 announcement. 2023-11-17 17:05:05 +01:00
Sergio Benitez f7a6c8610e Update FAQ for 0.5.0. 2023-11-17 17:05:02 +01:00
Sergio Benitez 6d467564d6 Update version numbers for 0.5.0. 2023-11-17 17:04:59 +01:00
Sergio Benitez 6bcab27101 Initial news article for v0.5 release. 2023-11-17 17:04:56 +01:00
Sergio Benitez f25954fef0 Add WebSocket section to upgrading guide. 2023-11-17 17:04:54 +01:00
Sergio Benitez e6985c50e8 Add 0.5.0 CHANGELOG entry. 2023-11-17 17:04:52 +01:00
Sergio Benitez 124ec94b46 Fix typos.
Co-authored-by: cui fliter <imcusg@gmail.com>
2023-11-17 17:04:49 +01:00
Sergio Benitez 0d48743bd8 Fix broken site links. 2023-11-17 17:04:47 +01:00
Sergio Benitez a1c29c735c New version: 0.5.0-rc.4.
New contrib versions: 0.1.0-rc.4.
2023-11-17 17:04:44 +01:00
Sergio Benitez 3a935c2c22 Add CHANGELOG for 0.5.0-rc.4. 2023-11-17 17:04:42 +01:00
Juhasz Sandor 1c3342d5af Update 'diesel-async' to '0.4.1'. 2023-11-17 16:15:54 +01:00
Sergio Benitez 15637186ba Document '&[u8]' form/data guard, limits. 2023-11-01 18:51:26 -05:00
Benjamin B f14f93afa7 Fix typo in pastebin tutorial: 'route' -> 'wrote'. 2023-11-01 17:41:48 -05:00
Sergio Benitez 1df854e13a Add a "clear message" button to cookies example. 2023-11-01 12:08:57 -05:00
Sergio Benitez fa0c778276 Set 'SameSite' to 'Lax' on removal cookies.
This avoids needless warnings from certain browsers.
2023-11-01 12:08:26 -05:00
Sergio Benitez 48d1b82e84 Qualm various emerging unused warnings. 2023-11-01 01:16:28 -05:00
Sergio Benitez fbd1a0d069 Improve forwarding status code precision.
Previously, the `NotFound` status code was used to signal many kinds of
recoverable, forwarding errors. This included validation errors, incorrect
Content-Type errors, and more.

This commit modifies the status code used to forward in these instances to more
precisely indicate the forwarding condition. In particular:

  * Parameter `FromParam` errors now forward as 422 (`UnprocessableEntity`).
  * Query paramater errors now forward as 422 (`UnprocessableEntity`).
  * Use of incorrect form content-type forwards as 413 (`UnsupportedMediaType`).
  * `WebSocket` guard now forwards as 400 (`BadRequest`).
  * `&Host`, `&Accept`, `&ContentType`, `IpAddr`, and `SocketAddr` all forward
    with a 500 (`InternalServerError`).

Additionally, the `IntoOutcome` trait was overhauled to support functionality
previously offered by methods on `Outcome`. The `Outcome::forward()` method now
requires a status code to use for the forwarding outcome.

Finally, logging of `Outcome`s now includes the relevant status code.

Resolves #2626.
2023-10-31 18:44:37 -05:00
Sergio Benitez c90812051e Rename 'Outcome::Failure' to 'Outcome::Error'.
The primary motivation is to deconflate the leading `F`s in `Failure` and
`Forward`. In particular, when using a generics, we used `F` for forward, which
could easily be confused for `F` for `Failure`. This resolves the conflation.
2023-10-31 12:17:28 -05:00
Steven Murdoch 11c9c3cbcd Fix off-by-one, improve style in forms example. 2023-10-27 15:19:48 -05:00
Sergio Benitez 260e671d43 Use mixed-site spans to avoid clippy 'uri!' error.
Closes #2630.
2023-10-27 14:50:48 -05:00