add compatibility for \r\r\n
This commit is contained in:
parent
987024430b
commit
b64c032bff
2 changed files with 6 additions and 1 deletions
|
@ -136,6 +136,11 @@ pub const TILDE: u8 = 0x7E; // ~
|
|||
// GROUP OF CHARACTERS
|
||||
// -- CRLF
|
||||
pub const CRLF: &[u8] = &[CR, LF];
|
||||
// -- CRCRLF
|
||||
// Sometimes portable libraries replace transparently
|
||||
// the "\n" with "\r\n" on Windows. When developpers
|
||||
// explicitly write "\r\n", the library generates "\r\r\n".
|
||||
pub const CRCRLF: &[u8] = &[CR, CR, LF];
|
||||
|
||||
// -- WHITESPACE
|
||||
pub const WS: &[u8] = &[HT, SP];
|
||||
|
|
|
@ -22,7 +22,7 @@ use nom::{
|
|||
/// \r or \n is allowed nowhere else, so we also add this support.
|
||||
|
||||
pub fn obs_crlf(input: &[u8]) -> IResult<&[u8], &[u8]> {
|
||||
alt((tag(ascii::CRLF), tag(&[ascii::CR]), tag(&[ascii::LF])))(input)
|
||||
alt((tag(ascii::CRLF), tag(ascii::CRCRLF), tag(&[ascii::CR]), tag(&[ascii::LF])))(input)
|
||||
}
|
||||
|
||||
/// ```abnf
|
||||
|
|
Loading…
Reference in a new issue