You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2011/04/25 19:47:31 UTC

Unexpected content IDs on multipart/form-data

I'm just posting a form from Chrome. Note the strange content-id,
which is the same in all of my attachments. This is with 2.4.0.

{Content-Disposition=[form-data; name="file"; filename="cmp.patch"],
Content-Type=[application/octet-stream], Content-ID=[Content-ID:
<root.message@cxf.apache.org]}

Re: Unexpected content IDs on multipart/form-data

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Benson

Thanks a million for a fix :-).

I just looked again at the original code which had
"Content-ID: <root.message@cxf.apache.org";

and finally realized that 'Content-ID' was actually part of the
Content-ID (default) value, took me a bit of time to spot it :-)

Cheers, Sergey

On Mon, Apr 25, 2011 at 11:34 PM, Benson Margulies
<bi...@gmail.com> wrote:
> r1096623
>
>
> On Mon, Apr 25, 2011 at 6:00 PM, Sergey Beryozkin <sb...@gmail.com> wrote:
>> Hi
>>
>> On Mon, Apr 25, 2011 at 7:05 PM, Daniel Kulp <dk...@apache.org> wrote:
>>> On Monday 25 April 2011 1:57:48 PM Benson Margulies wrote:
>>>> Well, but why is the trailing > omitted?
>>>
>>> Looks like a bug:
>>>
>>> Line 159 of Attachment Util:
>>> id = "Content-ID: <root.message@cxf.apache.org";
>>>
>>> Likely something is  wrong around there.   The best option is probably to move
>>> the "decode" into the above "if" and set the id to just
>>> root.message@cxf.apache.org or something at that point.
>>>
>>
>> OK, I think that if should also be changed a bit, to move the check
>> for '<' inside of the if block, because replacing Content-Ids which
>> may not have angle brackets with default values seems not right
>>
>>> And "Content-ID: " definitely shouldn't be there.
>>>
>>
>> Benson - can you please get the list of Attachments from MultipartBody
>> and check individual Attachment headers ?
>> How is Content-ID reported ? Or is it how you found about malformed
>> (default) Content-IDs in the first place ?
>>
>>> Can you log that (and maybe fix it)?
>>
>> Benson created JIRA and I'll look into it. That should not affect
>> multipart/form-data requests much as @Multipart and
>> MultipartBody.getAttachmentObject will also check Content-Disposition,
>> but has to be fixed anyway.
>>
>> Cheers, Sergey
>>
>>>
>>> Dan
>>>
>>>
>>>
>>>>
>>>> On Mon, Apr 25, 2011 at 1:53 PM, Sergey Beryozkin <sb...@gmail.com>
>>> wrote:
>>>> > Hi
>>>> >
>>>> > On Mon, Apr 25, 2011 at 6:47 PM, Benson Margulies <bi...@gmail.com>
>>> wrote:
>>>> >> I'm just posting a form from Chrome. Note the strange content-id,
>>>> >> which is the same in all of my attachments. This is with 2.4.0.
>>>> >>
>>>> >> {Content-Disposition=[form-data; name="file"; filename="cmp.patch"],
>>>> >> Content-Type=[application/octet-stream], Content-ID=[Content-ID:
>>>> >> <root.message@cxf.apache.org]}
>>>> >
>>>> > CXF probably defaults to <ro...@cxf.apache.org> on the input ?
>>>> > The format is a bit strange all right, but I think Content-Id is
>>>> > actually OK, you can get the list of headers and Content-Id in
>>>> > particular from Attachment objects and confirm
>>>> >
>>>> > Cheers, Sergey
>>>
>>> --
>>> Daniel Kulp
>>> dkulp@apache.org
>>> http://dankulp.com/blog
>>> Talend - http://www.talend.com
>>>
>>
>

Re: Unexpected content IDs on multipart/form-data

Posted by Benson Margulies <bi...@gmail.com>.
r1096623


On Mon, Apr 25, 2011 at 6:00 PM, Sergey Beryozkin <sb...@gmail.com> wrote:
> Hi
>
> On Mon, Apr 25, 2011 at 7:05 PM, Daniel Kulp <dk...@apache.org> wrote:
>> On Monday 25 April 2011 1:57:48 PM Benson Margulies wrote:
>>> Well, but why is the trailing > omitted?
>>
>> Looks like a bug:
>>
>> Line 159 of Attachment Util:
>> id = "Content-ID: <root.message@cxf.apache.org";
>>
>> Likely something is  wrong around there.   The best option is probably to move
>> the "decode" into the above "if" and set the id to just
>> root.message@cxf.apache.org or something at that point.
>>
>
> OK, I think that if should also be changed a bit, to move the check
> for '<' inside of the if block, because replacing Content-Ids which
> may not have angle brackets with default values seems not right
>
>> And "Content-ID: " definitely shouldn't be there.
>>
>
> Benson - can you please get the list of Attachments from MultipartBody
> and check individual Attachment headers ?
> How is Content-ID reported ? Or is it how you found about malformed
> (default) Content-IDs in the first place ?
>
>> Can you log that (and maybe fix it)?
>
> Benson created JIRA and I'll look into it. That should not affect
> multipart/form-data requests much as @Multipart and
> MultipartBody.getAttachmentObject will also check Content-Disposition,
> but has to be fixed anyway.
>
> Cheers, Sergey
>
>>
>> Dan
>>
>>
>>
>>>
>>> On Mon, Apr 25, 2011 at 1:53 PM, Sergey Beryozkin <sb...@gmail.com>
>> wrote:
>>> > Hi
>>> >
>>> > On Mon, Apr 25, 2011 at 6:47 PM, Benson Margulies <bi...@gmail.com>
>> wrote:
>>> >> I'm just posting a form from Chrome. Note the strange content-id,
>>> >> which is the same in all of my attachments. This is with 2.4.0.
>>> >>
>>> >> {Content-Disposition=[form-data; name="file"; filename="cmp.patch"],
>>> >> Content-Type=[application/octet-stream], Content-ID=[Content-ID:
>>> >> <root.message@cxf.apache.org]}
>>> >
>>> > CXF probably defaults to <ro...@cxf.apache.org> on the input ?
>>> > The format is a bit strange all right, but I think Content-Id is
>>> > actually OK, you can get the list of headers and Content-Id in
>>> > particular from Attachment objects and confirm
>>> >
>>> > Cheers, Sergey
>>
>> --
>> Daniel Kulp
>> dkulp@apache.org
>> http://dankulp.com/blog
>> Talend - http://www.talend.com
>>
>

Re: Unexpected content IDs on multipart/form-data

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

On Mon, Apr 25, 2011 at 7:05 PM, Daniel Kulp <dk...@apache.org> wrote:
> On Monday 25 April 2011 1:57:48 PM Benson Margulies wrote:
>> Well, but why is the trailing > omitted?
>
> Looks like a bug:
>
> Line 159 of Attachment Util:
> id = "Content-ID: <root.message@cxf.apache.org";
>
> Likely something is  wrong around there.   The best option is probably to move
> the "decode" into the above "if" and set the id to just
> root.message@cxf.apache.org or something at that point.
>

OK, I think that if should also be changed a bit, to move the check
for '<' inside of the if block, because replacing Content-Ids which
may not have angle brackets with default values seems not right

> And "Content-ID: " definitely shouldn't be there.
>

Benson - can you please get the list of Attachments from MultipartBody
and check individual Attachment headers ?
How is Content-ID reported ? Or is it how you found about malformed
(default) Content-IDs in the first place ?

> Can you log that (and maybe fix it)?

Benson created JIRA and I'll look into it. That should not affect
multipart/form-data requests much as @Multipart and
MultipartBody.getAttachmentObject will also check Content-Disposition,
but has to be fixed anyway.

Cheers, Sergey

>
> Dan
>
>
>
>>
>> On Mon, Apr 25, 2011 at 1:53 PM, Sergey Beryozkin <sb...@gmail.com>
> wrote:
>> > Hi
>> >
>> > On Mon, Apr 25, 2011 at 6:47 PM, Benson Margulies <bi...@gmail.com>
> wrote:
>> >> I'm just posting a form from Chrome. Note the strange content-id,
>> >> which is the same in all of my attachments. This is with 2.4.0.
>> >>
>> >> {Content-Disposition=[form-data; name="file"; filename="cmp.patch"],
>> >> Content-Type=[application/octet-stream], Content-ID=[Content-ID:
>> >> <root.message@cxf.apache.org]}
>> >
>> > CXF probably defaults to <ro...@cxf.apache.org> on the input ?
>> > The format is a bit strange all right, but I think Content-Id is
>> > actually OK, you can get the list of headers and Content-Id in
>> > particular from Attachment objects and confirm
>> >
>> > Cheers, Sergey
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> Talend - http://www.talend.com
>

Re: Unexpected content IDs on multipart/form-data

Posted by Daniel Kulp <dk...@apache.org>.
On Monday 25 April 2011 1:57:48 PM Benson Margulies wrote:
> Well, but why is the trailing > omitted?

Looks like a bug:

Line 159 of Attachment Util:
id = "Content-ID: <root.message@cxf.apache.org";

Likely something is  wrong around there.   The best option is probably to move 
the "decode" into the above "if" and set the id to just 
root.message@cxf.apache.org or something at that point.

And "Content-ID: " definitely shouldn't be there.

Can you log that (and maybe fix it)?

Dan



> 
> On Mon, Apr 25, 2011 at 1:53 PM, Sergey Beryozkin <sb...@gmail.com> 
wrote:
> > Hi
> > 
> > On Mon, Apr 25, 2011 at 6:47 PM, Benson Margulies <bi...@gmail.com> 
wrote:
> >> I'm just posting a form from Chrome. Note the strange content-id,
> >> which is the same in all of my attachments. This is with 2.4.0.
> >> 
> >> {Content-Disposition=[form-data; name="file"; filename="cmp.patch"],
> >> Content-Type=[application/octet-stream], Content-ID=[Content-ID:
> >> <root.message@cxf.apache.org]}
> > 
> > CXF probably defaults to <ro...@cxf.apache.org> on the input ?
> > The format is a bit strange all right, but I think Content-Id is
> > actually OK, you can get the list of headers and Content-Id in
> > particular from Attachment objects and confirm
> > 
> > Cheers, Sergey

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Talend - http://www.talend.com

Re: Unexpected content IDs on multipart/form-data

Posted by Benson Margulies <bi...@gmail.com>.
Well, but why is the trailing > omitted?

On Mon, Apr 25, 2011 at 1:53 PM, Sergey Beryozkin <sb...@gmail.com> wrote:
> Hi
>
> On Mon, Apr 25, 2011 at 6:47 PM, Benson Margulies <bi...@gmail.com> wrote:
>> I'm just posting a form from Chrome. Note the strange content-id,
>> which is the same in all of my attachments. This is with 2.4.0.
>>
>> {Content-Disposition=[form-data; name="file"; filename="cmp.patch"],
>> Content-Type=[application/octet-stream], Content-ID=[Content-ID:
>> <root.message@cxf.apache.org]}
>>
> CXF probably defaults to <ro...@cxf.apache.org> on the input ?
> The format is a bit strange all right, but I think Content-Id is
> actually OK, you can get the list of headers and Content-Id in
> particular from Attachment objects and confirm
>
> Cheers, Sergey
>

Re: Unexpected content IDs on multipart/form-data

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

On Mon, Apr 25, 2011 at 6:47 PM, Benson Margulies <bi...@gmail.com> wrote:
> I'm just posting a form from Chrome. Note the strange content-id,
> which is the same in all of my attachments. This is with 2.4.0.
>
> {Content-Disposition=[form-data; name="file"; filename="cmp.patch"],
> Content-Type=[application/octet-stream], Content-ID=[Content-ID:
> <root.message@cxf.apache.org]}
>
CXF probably defaults to <ro...@cxf.apache.org> on the input ?
The format is a bit strange all right, but I think Content-Id is
actually OK, you can get the list of headers and Content-Id in
particular from Attachment objects and confirm

Cheers, Sergey