You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Siddharth Taduri (JIRA)" <ji...@apache.org> on 2013/04/05 23:23:15 UTC
[jira] [Commented] (ASYNCWEB-26) HTTP header parsing example
incompatible with rfc2616 / content-length field name should be interrepted
as case-insensitive
[ https://issues.apache.org/jira/browse/ASYNCWEB-26?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13624076#comment-13624076 ]
Siddharth Taduri commented on ASYNCWEB-26:
------------------------------------------
Has this ever been fixed? I'm certain that this is causing problems.
> HTTP header parsing example incompatible with rfc2616 / content-length field name should be interrepted as case-insensitive
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: ASYNCWEB-26
> URL: https://issues.apache.org/jira/browse/ASYNCWEB-26
> Project: Asyncweb
> Issue Type: Bug
> Environment: Linux
> Reporter: Janne Siren
> Assignee: Emmanuel Lecharny
> Priority: Critical
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> Qt4 (4.4.3) QHttp class sends HTTP/POST command with HTTP header which has "content-length" field name in small letters. HTTP header parsing functionality in MINA Example does not accept these POST commands as it expects case-sensitive field name "Content-Length". MINA Example HTTP header parser functionality incorrectly drops these POST messages send by Qt4 QHttp class although those messages are fully compatible with rfc2616. Cut from rfc2616 (4.2 Message Headers): Field names are case-insensitive.
> The problem (at least in MINA-1.1.0) is in org.apache.mina.example.httpserver.codec.HttpRequestDecoder.java:
> private static final byte[] CONTENT_LENGTH = new String( "Content-Length:" )
> .getBytes();
> ...
> boolean found = false;
> for( int j = 0; j < CONTENT_LENGTH.length; j++ )
> {
> if( in.get( i + j ) != CONTENT_LENGTH[ j ] )
> {
> found = false;
> break;
> }
> found = true;
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira