mirror of
https://github.com/rwf2/Rocket.git
synced 2025-01-22 01:12:07 +00:00
Merge branch 'rwf2:master' into fix_issue_1224
This commit is contained in:
commit
fd4a6f5cde
@ -22,7 +22,7 @@ minijinja = ["dep:minijinja"]
|
||||
|
||||
[dependencies]
|
||||
walkdir = "2.4"
|
||||
notify = "6"
|
||||
notify = "7"
|
||||
normpath = "1"
|
||||
|
||||
tera = { version = "1.19.0", optional = true }
|
||||
|
@ -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"
|
||||
|
@ -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> {
|
||||
@ -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> {
|
||||
|
@ -121,14 +121,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]
|
||||
|
@ -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)?;
|
||||
|
@ -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")))?;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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`
|
||||
|
@ -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?;
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user