Skip to content

Commit

Permalink
Merge branch 'rwf2:master' into issue_1067_typed_headers
Browse files Browse the repository at this point in the history
  • Loading branch information
jespersm authored Dec 2, 2024
2 parents 368288e + 28891e8 commit 81461b4
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 28 deletions.
2 changes: 1 addition & 1 deletion contrib/dyn_templates/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ minijinja = ["dep:minijinja"]

[dependencies]
walkdir = "2.4"
notify = "6"
notify = "7"
normpath = "1"

tera = { version = "1.19.0", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion contrib/ws/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ default = ["tungstenite"]
tungstenite = ["tokio-tungstenite"]

[dependencies]
tokio-tungstenite = { version = "0.23", optional = true }
tokio-tungstenite = { version = "0.24", optional = true }

[dependencies.rocket]
version = "0.6.0-dev"
Expand Down
17 changes: 4 additions & 13 deletions core/http/src/raw_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,19 +258,9 @@ impl RawStr {
/// # extern crate rocket;
/// use rocket::http::RawStr;
///
/// let raw_str = RawStr::new("Hello%21");
/// let decoded = raw_str.percent_decode();
/// assert_eq!(decoded, Ok("Hello!".into()));
/// ```
///
/// With an invalid string:
///
/// ```rust
/// # extern crate rocket;
/// use rocket::http::RawStr;
///
/// let bad_raw_str = RawStr::new("%FF");
/// assert!(bad_raw_str.percent_decode().is_err());
/// let raw_str = RawStr::new("Hello/goodbye");
/// let encoded = raw_str.percent_encode();
/// assert_eq!(encoded.as_str(), "Hello%2Fgoodbye");
/// ```
#[inline(always)]
pub fn percent_encode(&self) -> Cow<'_, RawStr> {
Expand All @@ -288,6 +278,7 @@ impl RawStr {
/// // Note: Rocket should never hand you a bad `&RawStr`.
/// let bytes = &[93, 12, 0, 13, 1];
/// let encoded = RawStr::percent_encode_bytes(&bytes[..]);
/// assert_eq!(encoded.as_str(), "]%0C%00%0D%01");
/// ```
#[inline(always)]
pub fn percent_encode_bytes(bytes: &[u8]) -> Cow<'_, RawStr> {
Expand Down
4 changes: 2 additions & 2 deletions core/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ version = "2.1.0"
optional = true

[dependencies.s2n-quic]
version = "1.36"
version = "1.51"
default-features = false
features = ["provider-address-token-default", "provider-tls-rustls"]
optional = true

[dependencies.s2n-quic-h3]
git = "https://github.com/SergioBenitez/s2n-quic-h3.git"
rev = "6613956"
rev = "f832471"
optional = true

[target.'cfg(unix)'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/listener/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Bind for TcpListener {
type Error = Either<figment::Error, io::Error>;

async fn bind(rocket: &Rocket<Ignite>) -> Result<Self, Self::Error> {
let endpoint = Self::bind_endpoint(&rocket)?;
let endpoint = Self::bind_endpoint(rocket)?;
let addr = endpoint.tcp()
.ok_or_else(|| io::Error::other("internal error: invalid endpoint"))
.map_err(Right)?;
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/listener/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl Bind for UnixListener {
type Error = Either<figment::Error, io::Error>;

async fn bind(rocket: &Rocket<Ignite>) -> Result<Self, Self::Error> {
let endpoint = Self::bind_endpoint(&rocket)?;
let endpoint = Self::bind_endpoint(rocket)?;
let path = endpoint.unix()
.ok_or_else(|| Right(io::Error::other("internal error: invalid endpoint")))?;

Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/request/from_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use crate::http::uri::{Segments, error::PathError, fmt::Path};
/// If `usize::from_param` returns an `Ok(usize)` variant, the encapsulated
/// value is used as the `id` function parameter. If not, the request is
/// forwarded to the next matching route. Since there are no additional matching
/// routes, this example will result in a 404 error for requests with invalid
/// routes, this example will result in a 422 error for requests with invalid
/// `id` values.
///
/// # Catching Errors
Expand Down
2 changes: 1 addition & 1 deletion core/lib/src/sentinel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ use crate::{Rocket, Ignite};
///
/// **Note:** _Rocket actively discourages using `impl Trait` in route
/// signatures. In addition to impeding sentinel discovery, doing so decreases
/// the ability to gleam a handler's functionality based on its type signature._
/// the ability to glean a handler's functionality based on its type signature._
///
/// The return type of the route `f` depends on its implementation. At present,
/// it is not possible to name the underlying concrete type of an `impl Trait`
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/05-requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ use rocket::data::{Data, ToByteUnit};

#[post("/debug", data = "<data>")]
async fn debug(data: Data<'_>) -> std::io::Result<()> {
// Stream at most 512KiB all of the body data to stdout.
// Stream at most 512KiB of the body data to stdout.
data.open(512.kibibytes())
.stream_to(tokio::io::stdout())
.await?;
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/10-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ summary = "overview and customization of Rocket application configuration"

Rocket's configuration system is flexible. Based on [Figment](@figment), it
allows you to configure your application the way _you_ want while also providing
with a sensible set of defaults.
a sensible set of defaults.

## Overview

Expand Down
10 changes: 5 additions & 5 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,17 @@ function test_default() {
indir "${BENCHMARKS_ROOT}" $CARGO update
indir "${BENCHMARKS_ROOT}" $CARGO check --benches --all-features $@

echo ":: Checking fuzzers..."
indir "${FUZZ_ROOT}" $CARGO update
indir "${FUZZ_ROOT}" $CARGO check --all --all-features $@

case "$OSTYPE" in
darwin* | linux*)
echo ":: Checking testbench..."
indir "${TESTBENCH_ROOT}" $CARGO update
indir "${TESTBENCH_ROOT}" $CARGO check $@

echo ":: Checking fuzzers..."
indir "${FUZZ_ROOT}" $CARGO update
indir "${FUZZ_ROOT}" $CARGO check --all --all-features $@
;;
*) echo ":: Skipping testbench [$OSTYPE]" ;;
*) echo ":: Skipping testbench, fuzzers [$OSTYPE]" ;;
esac
}

Expand Down

0 comments on commit 81461b4

Please sign in to comment.