else if let Some(start) = find_iter.next() { start + boundary.len() }
else { throw!(anyhow!("initial boundary not found")) };
+ let comp = multipart::process_component
+ (&mut warnings, &initial[start..], PartName::m)?;
-/*
- let comp = multipart::process_component(
-
- if {
-
-initial[start..].strip_prefixstarts_with(b"\n")
- || initial[start..].starts_with(b"\r\n")*/
-
- eprintln!("boundary={:?} initial={:?} start={}",
- boundary, initial, start);
+ eprintln!("boundary={:?} initial={:?} start={} comp={:?}",
+ boundary, initial, start, &comp);
Ok::<_,AE>(())
}.await {
use crate::prelude::*;
+#[derive(Debug)]
pub struct Component<'b> {
pub name: PartName,
pub payload_start: &'b [u8],
regex_captures!(r#"^Content-Disposition[ \t]*:[ \t]*(.*)$"#i, l) { y }
else { return Ok(()) };
+ let disposition = disposition.trim_end();
+ if disposition.len() >= 100 { throw!(anyhow!(
+ "Content-Disposition value implausibly long"
+ )) }
+ // This let's us pretend it's a mime type, so we can use mime::Mime
+ let disposition = format!("dummy/{}", disposition);
+
let disposition: mime::Mime = disposition.parse()
.context("parse Content-Disposition")?;
let name = disposition.get_param("name")
pub use crate::config::{self, InstanceConfig, u32Ext as _};
pub use crate::ini;
pub use crate::ipif::Ipif;
+pub use crate::multipart::{self, PartName};
pub use crate::utils::*;
pub use crate::queue::*;
pub use crate::reporter::*;