Skip to content

Commit

Permalink
feat(http): add multipart for server
Browse files Browse the repository at this point in the history
  • Loading branch information
StellarisW committed Oct 22, 2024
1 parent aa2970f commit 92279c6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion volo-http/src/server/layer/body_limit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct BodyLimitLayer {
}

impl BodyLimitLayer {
/// Create a new [`BodyLimitLayer`] with given [`body_limit`].
/// Create a new [`BodyLimitLayer`] with given `body_limit`.
///
/// If the Body is larger than the `body_limit`, the request will be rejected.
///
Expand Down
2 changes: 1 addition & 1 deletion volo-http/src/server/layer/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Collections of some useful [`Layer`]s.
//! Collections of some useful `Layer`s.
//!
//! See [`FilterLayer`] and [`TimeoutLayer`] for more details.

Expand Down
3 changes: 2 additions & 1 deletion volo-http/src/server/utils/multipart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ use crate::{
///
/// # Body Limitation
///
/// Since the body is unlimited, so it is recommended to use [`BodyLimitLayer`] to limit the size of
/// Since the body is unlimited, so it is recommended to use [`BodyLimitLayer`](crate::server::layer::BodyLimitLayer) to limit the size of
/// the body.
///
/// ```rust,no_run
Expand Down Expand Up @@ -117,6 +117,7 @@ impl<'r> Multipart<'r> {
/// while let Some(field) = multipart.next_field().await? {
/// let name = field.name().unwrap().to_string(); // Get field name
/// let data = field.bytes().await?; // Get field data
/// }
/// # }
/// ```
pub async fn next_field(&mut self) -> Result<Option<Field<'r>>, MultipartRejectionError> {
Expand Down

0 comments on commit 92279c6

Please sign in to comment.