Skip to main content

unstructured

Function unstructured 

Source
pub fn unstructured(input: &[u8]) -> IResult<&[u8], Unstructured<'_>>
Expand description

Unstructured header field body

Grammar from the RFC:

unstructured    =   (*([FWS] VCHAR_SEQ) *WSP) / obs-unstruct
obs-unstruct    =   *((*CR 1*(obs_utext / FWS)) / 1*LF) *CR   (cf errata)
  • RFC 2047 (MIME pt3) encoded words

However, in our relaxed parsing of line endings in whitespace::obs_crlf, bare CR or LF are treated as line endings and thus cannot also be part of the obs-unstruct syntax.

We thus choose to parse obs-unstruct minus the bare CR and LF, which corresponds to (also adding RFC2047 encoded words):

our-obs-unstruct = *(encoded-words / obs_utext / FWS)

This does not match the RFC but seems to better match real-world practices.