fix bug
This commit is contained in:
parent
486ccf2de0
commit
c62f803a95
2 changed files with 3 additions and 2 deletions
|
@ -275,9 +275,10 @@ fn unknown_field(input: &str) -> IResult<&str, HeaderField> {
|
||||||
// Extract field name
|
// Extract field name
|
||||||
let (input, field_name) = field_name(input)?;
|
let (input, field_name) = field_name(input)?;
|
||||||
let (input, body) = unstructured(input)?;
|
let (input, body) = unstructured(input)?;
|
||||||
|
let (input, _) = perm_crlf(input)?;
|
||||||
Ok((input, HeaderField::Optional(field_name, body)))
|
Ok((input, HeaderField::Optional(field_name, body)))
|
||||||
}
|
}
|
||||||
pub fn field_name(input: &str) -> IResult<&str, &str> {
|
fn field_name(input: &str) -> IResult<&str, &str> {
|
||||||
terminated(
|
terminated(
|
||||||
take_while1(|c| c >= '\x21' && c <= '\x7E' && c != '\x3A'),
|
take_while1(|c| c >= '\x21' && c <= '\x7E' && c != '\x3A'),
|
||||||
pair(tag(":"), space0)
|
pair(tag(":"), space0)
|
||||||
|
|
|
@ -55,7 +55,7 @@ mod tests {
|
||||||
use chrono::{FixedOffset, TimeZone};
|
use chrono::{FixedOffset, TimeZone};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_received() {
|
fn test_received_body() {
|
||||||
let hdrs = r#"from smtp.example.com ([10.83.2.2])
|
let hdrs = r#"from smtp.example.com ([10.83.2.2])
|
||||||
by server with LMTP
|
by server with LMTP
|
||||||
id xxxxxxxxx
|
id xxxxxxxxx
|
||||||
|
|
Loading…
Reference in a new issue