Bug in HttpHeaderReader

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Bug in HttpHeaderReader

Adam Ryan

Hi,

 

I believe there is a bug in org.glassfish.jersey.message.internal.HttpHeaderReader:306.

 

If you look at RFC 1867, section 6 (Examples), the boundary is defined in the Content-Type header following a comma (I understand other RFCs use semi-colons here, but not this one), but if I use a comma here when using Jersey I get the following stack trace:

 

java.text.ParseException: Expected separator ';' instead of ','

         at org.glassfish.jersey.message.internal.HttpHeaderReader.nextSeparator(HttpHeaderReader.java:146)

         at org.glassfish.jersey.message.internal.HttpHeaderReader.readParameters(HttpHeaderReader.java:306)

         at org.glassfish.jersey.message.internal.HttpHeaderReader.readParameters(HttpHeaderReader.java:296)

         at org.glassfish.jersey.message.internal.MediaTypeProvider.valueOf(MediaTypeProvider.java:118)

         at org.glassfish.jersey.message.internal.MediaTypeProvider.fromString(MediaTypeProvider.java:90)

         ... 34 more

 

By simply changing my request to use a semi-colon here I get a successful request.

 

My issue here is that Jersey should support what is written by the IETF, but at the moment it does not.

 

Thanks,

Adam

 

Adam Ryan

Qvalent Pty. Ltd. (a subsidiary of Westpac Banking Corporation)

phone: (02) 49510080 | fax: (02) 49510055 | email: [hidden email] website: www.qvalent.com

 




Please consider our environment before printing this email.

WARNING - This email and any attachments may be confidential. If received in error, please delete and inform us by return email. Because emails and attachments may be interfered with, may contain computer viruses or other defects and may not be successfully replicated on other systems, you must be cautious. Qvalent cannot guarantee that what you receive is what we sent. If you have any doubts about the authenticity of an email sent by Qvalent, please contact us immediately.

It is also important to check for viruses and defects before opening or using attachments. Qvalent's liability is limited to resupplying any affected attachments.

Qvalent is a wholly owned subsidiary of the Westpac Banking Corporation.

Qvalent Pty Ltd ABN 71 088 314 827
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bug in HttpHeaderReader

Pavel Bucek-2
Hi Adam,

can you please present the header (content-type) value, which cannot be parsed by current parser?

Thanks,
Pavel

On 03/03/16 05:58, Adam Ryan wrote:

Hi,

 

I believe there is a bug in org.glassfish.jersey.message.internal.HttpHeaderReader:306.

 

If you look at RFC 1867, section 6 (Examples), the boundary is defined in the Content-Type header following a comma (I understand other RFCs use semi-colons here, but not this one), but if I use a comma here when using Jersey I get the following stack trace:

 

java.text.ParseException: Expected separator ';' instead of ','

         at org.glassfish.jersey.message.internal.HttpHeaderReader.nextSeparator(HttpHeaderReader.java:146)

         at org.glassfish.jersey.message.internal.HttpHeaderReader.readParameters(HttpHeaderReader.java:306)

         at org.glassfish.jersey.message.internal.HttpHeaderReader.readParameters(HttpHeaderReader.java:296)

         at org.glassfish.jersey.message.internal.MediaTypeProvider.valueOf(MediaTypeProvider.java:118)

         at org.glassfish.jersey.message.internal.MediaTypeProvider.fromString(MediaTypeProvider.java:90)

         ... 34 more

 

By simply changing my request to use a semi-colon here I get a successful request.

 

My issue here is that Jersey should support what is written by the IETF, but at the moment it does not.

 

Thanks,

Adam

 

Adam Ryan

Qvalent Pty. Ltd. (a subsidiary of Westpac Banking Corporation)

phone: (02) 49510080 | fax: (02) 49510055 | email: [hidden email] website: www.qvalent.com

 




Please consider our environment before printing this email.

WARNING - This email and any attachments may be confidential. If received in error, please delete and inform us by return email. Because emails and attachments may be interfered with, may contain computer viruses or other defects and may not be successfully replicated on other systems, you must be cautious. Qvalent cannot guarantee that what you receive is what we sent. If you have any doubts about the authenticity of an email sent by Qvalent, please contact us immediately.

It is also important to check for viruses and defects before opening or using attachments. Qvalent's liability is limited to resupplying any affected attachments.

Qvalent is a wholly owned subsidiary of the Westpac Banking Corporation.

Qvalent Pty Ltd ABN 71 088 314 827

Loading...