[ https://issues.apache.org/jira/browse/DIRMINA-666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12678051#action_12678051 ]
Janne Siren commented on DIRMINA-666: ------------------------------------- Yes. Typo should have been 0x20 (32)... but as you said it would accept 'm' as replacement of '-', so our quick-and-dirty fix is not good. (Anyhow I am not so worried about accepting illegal header than not accepting legal headers.) I am bit confused though from Your comment that RFC uses case sensitive headers for these specific headers. I do not find anywhere statement about that. RFC2616, section 4.2 says: "HTTP header fields, which include general-header (section 4.5), request-header (section 5.3), response-header (section 6.2), and entity-header (section 7.1) fields, follow the same generic format as that given in section 3.1 of RFC 822 [9]. Each header field consists of a name followed by a colon (":") and the field value. Field names are case-insensitive." I cannot find anything from section 7.1 that states that these entity-headers are case-sensitive. And in 14.13 I cannot find anything that says that Content-Length field name is case sensitive. But I am very pleased if you can state to which clause in RFC do you refer in your oppinion. If you are correct, I would have to make correction request to Qt-Software department of Nokia (old Trolltech). I most likely will do it anyway, but is it "for better compatibility with broken servers" or "Content-Lenght in POST of QHttp is incompatible with HTTP/1.1 specification" has quite significant meaning to Qt people. For your comment "just an example": Well I think that many codes of apache.org has originally been "just an example", but further developped to production quality code. So all feedback should be taken into account. I would not close it or transfer it to other project (it might be copied there if relevant), but tag it as "future developement" or mark it to code "// TODO: These fields should be handled case-insensitive", so that those who relies on quality of examples can easily find what problems are already found from example code. > HTTP header parsing example incompatible with rfc2616 / content-length field > name should be interrepted as case-insensitive > --------------------------------------------------------------------------------------------------------------------------- > > Key: DIRMINA-666 > URL: https://issues.apache.org/jira/browse/DIRMINA-666 > Project: MINA > Issue Type: Bug > Components: Example > Affects Versions: 1.1.0 > 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. - You can reply to this email to add a comment to the issue online.