james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Bagnara <apa...@bago.org>
Subject Re: Parsing header bug?
Date Thu, 24 Dec 2009 16:23:38 GMT
2009/12/24 Florent Georges <lists@fgeorges.org>:
>  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

Mime
View raw message