2009/12/24 Florent Georges <[email protected]>:
>  Hi,
>
>  I am using a MimeTokenStream to parse a multipart message.  I
> use parseHeadless() as my system already parses the headers of
> the multipart before giving me the input stream of its content.
> But for some reason, the Content-Type header seems to be wrongly
> parsed.  The following code:
>
>    LOG.debug("  field: '" + f.getBody() + "'");
>    LOG.debug("  field: '" + f.getRaw().toString() + "'");
>
> produces the following lines:
>
>    field: ' text/html'
>    field: 'Content-type: text/html'
>
>  See the extra space in the first line?  I guess it should not
> be there...
>
>  Any idea?

AFAIK the header value is anything after the ":". The space is
inserted by most mime writing code around, but it is not a required
separator in the mime specification. In fact if there is a space, it
is already part of the body value.

E.g: if you have "Content-type:text/html" then the getBody will return
"text/html" with no space.

Stefano

Reply via email to