use super::*;
#[derive(Clone, Debug, Eq, Getter, PartialEq)]
pub struct UploadedFile {
pub(crate) field_name: String,
pub(crate) filename: String,
pub(crate) content_type: String,
pub(crate) data: Vec<u8>,
}
#[derive(Clone, Debug, Default, Eq, Getter, PartialEq)]
pub struct ParsedMultipart {
pub(crate) fields: Vec<(String, String)>,
pub(crate) files: Vec<UploadedFile>,
}
#[derive(Clone, Data, Debug, Eq, PartialEq)]
pub struct MultipartConfig {
#[get(type(copy))]
pub(crate) max_total_bytes: usize,
#[get(type(copy))]
pub(crate) max_parts: usize,
#[get(type(copy))]
pub(crate) max_files: usize,
#[get(type(copy))]
pub(crate) max_file_bytes: usize,
#[get(type(copy))]
pub(crate) max_field_bytes: usize,
pub(crate) allowed_mime_prefixes: Vec<String>,
#[get(type(copy))]
pub(crate) sniff_mime: bool,
}
#[derive(Clone, Debug)]
pub struct MultipartPlugin {
pub(crate) config: MultipartConfig,
pub(crate) allowed_mime_lower: Box<[String]>,
pub(crate) bad_request_wire: Vec<u8>,
pub(crate) too_large_wire: Vec<u8>,
pub(crate) disallowed_mime_wire: Vec<u8>,
}
#[derive(Clone, Copy, Debug, Default)]
#[hyperlane::request_middleware(-76)]
pub struct MultipartHook;