Commit Graph

2297 Commits

Author SHA1 Message Date
Sergio Benitez b10702bf20 Remove custom 'docify!' macro: use '#[doc]`. 2024-01-17 21:53:12 -08:00
Paul Lietar 52de9a1fa6 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()`.
2024-01-17 21:53:12 -08:00
Martyn 61e77c5e13 Document "reconnect ad-infinitum" SSE pitfall. 2024-01-17 21:53:12 -08:00
Failpark 10b5da7035 Fix fairing naming in database MySQL example. 2024-01-17 21:53:12 -08:00
Mathew Horner fa79610bcd Fix git repository URLs in contrib crates. 2024-01-17 21:53:12 -08:00
Sergio Benitez 3bcdd076c3 Update 'deadpool' to 0.10.
Also updates:

  * 'deadpool-postgres'  to 0.12
  * 'deadpool-redis'  to 0.14
2024-01-17 21:53:12 -08:00
Sergio Benitez 9544715103 Update 'tungstenite' to '0.21'. 2024-01-17 21:53:12 -08:00
Sergio Benitez f2730fb509 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.
2024-01-17 21:42:08 -08:00
Sergio Benitez b23740f2a2 Update project sponsors. 2023-12-12 18:10:49 -08:00
Sergio Benitez 97992b69b4 Set 'img' width, height to decrease layout jitter. 2023-12-08 14:00:20 -08:00
Sergio Benitez 599d824940 Enable templateless issue creation. 2023-12-08 14:00:17 -08:00
Sergio Benitez f5dbcde484 Upgrade to GitHub issue forms. 2023-12-08 14:00:14 -08:00
Sergio Benitez 2ce7545f7e Silence more warnings in generated code. 2023-12-05 17:29:30 -08:00
Sergio Benitez 5d08294667 Add '.rustfmt.toml' disabling formatting. 2023-11-28 10:48:50 +01:00
Sergio Benitez b70fcc415d Add GitHub FUNDING file. 2023-11-28 10:48:48 +01:00
Sergio Benitez a24df46148 Update data for site refresh. 2023-11-27 15:00:55 +01:00
Sergio Benitez ab82064354 Update 'SergioBenitez/Rocket' to 'rwf2/Rocket'.
Resolves rwf2/rwf2#5.
2023-11-22 21:41:51 +01:00
Sergio Benitez c7d903d128 Use versioned URIs in news articles. 2023-11-18 11:43:40 +01:00
Sergio Benitez 0ada4b048f Fix various typos in v0.5 news and guide. 2023-11-18 10:44:17 +01:00
Sergio Benitez c20efb9a26 New version: 0.5.0. 2023-11-17 17:50:08 +01:00
Sergio Benitez 64cf1ee79e Polish news for v0.5. Add RWF2 announcement. 2023-11-17 17:50:06 +01:00
Sergio Benitez ba9f77643f Update FAQ for 0.5.0. 2023-11-17 16:38:14 +01:00
Sergio Benitez 38ae8d6317 Update version numbers for 0.5.0. 2023-11-17 16:38:14 +01:00
Sergio Benitez 3c4571850c Initial news article for v0.5 release. 2023-11-17 16:38:14 +01:00
Sergio Benitez daa4e3476c Add WebSocket section to upgrading guide. 2023-11-17 16:38:14 +01:00
Sergio Benitez f6916e6947 Add 0.5.0 CHANGELOG entry. 2023-11-17 16:38:14 +01:00
Sergio Benitez c06a51bd37 Fix typos.
Co-authored-by: cui fliter <imcusg@gmail.com>
2023-11-17 16:38:14 +01:00
Sergio Benitez a6a1a9e957 Fix broken site links. 2023-11-17 16:38:14 +01:00
Sergio Benitez 3ee6e5c758 New version: 0.5.0-rc.4.
New contrib versions: 0.1.0-rc.4.
2023-11-17 16:38:14 +01:00
Sergio Benitez 1e7e582173 Add CHANGELOG for 0.5.0-rc.4. 2023-11-17 16:38:14 +01:00
Juhasz Sandor 73cb12c9c9 Update 'diesel-async' to '0.4.1'. 2023-11-17 16:38:14 +01:00
Sergio Benitez 2ae91b9c9e Update UI tests. 2023-11-01 18:56:48 -05:00
Sergio Benitez 11fed5a466 Document '&[u8]' form/data guard, limits. 2023-11-01 18:56:48 -05:00
Benjamin B 8ed64d0b31 Fix typo in pastebin tutorial: 'route' -> 'wrote'. 2023-11-01 18:56:48 -05:00
Sergio Benitez 6f9d671321 Add a "clear message" button to cookies example. 2023-11-01 18:50:58 -05:00
Sergio Benitez 654b1c3c79 Set 'SameSite' to 'Lax' on removal cookies.
This avoids needless warnings from certain browsers.
2023-11-01 18:50:58 -05:00
Sergio Benitez df3a4e0dca Qualm various emerging unused warnings. 2023-11-01 18:50:58 -05:00
Sergio Benitez 186ec84f5b 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-11-01 18:50:58 -05:00
Sergio Benitez b6430e9970 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-11-01 18:50:55 -05:00
Steven Murdoch 55b7d4574a Fix off-by-one, improve style in forms example. 2023-10-29 18:27:20 -05:00
Sergio Benitez c6192c1c0b Use mixed-site spans to avoid clippy 'uri!' error.
Closes #2630.
2023-10-29 18:27:17 -05:00
Sergio Benitez 923b61edf3 Update UI tests. 2023-10-26 20:25:33 -05:00
许杰友 Jieyou Xu (Joe) 5bdafc272d Use Span::mixed_site to avoid let unit warnings.
Closes #2568.
2023-10-26 20:01:45 -05:00
Lev Kokotov 9eac525e7d Fix typo in 'rocket_ws' README. 2023-10-26 20:01:06 -05:00
Ruben Schmidmeister dc9e1ac6a1 Set 'color-scheme' in default catcher HTML. 2023-10-26 20:01:06 -05:00
Sergio Benitez a7536a3c6e Avoid using 'glob' to walk templates directory.
Previously, `dyn_templates` walked the user-provided `template_dir` path by
constructing a glob pattern prefixed with `template_dir`. If `template_dir`
contained characters recognized by the glob pattern parser, then at best the
pattern failed to parse, and at worst, incorrect directories were searched.

This commit removes the use of `glob` to walk the templates directory and
instead uses `walkdir`, obviating the issues described above.

Fixes #2627.
2023-10-26 20:01:06 -05:00
Fenhl a32ea70835 Upgrade 'tokio-tungstenite' to 0.20. 2023-10-26 20:01:06 -05:00
Sergio Benitez f38103da60 Update dependencies.
* notify: 5 -> 6
  * indexmap: 1 -> 2
  * cookie: 0.18.0-rc.0 -> 0.18
2023-10-26 20:01:06 -05:00
Sergio Benitez a20f9d8e89 Document that '&[u8]' is a form guard. 2023-10-26 20:01:06 -05:00
Sergio Benitez ed56056d0e Update 'cookie' to 0.18. 2023-10-26 20:01:06 -05:00