Hey,

In the apache mina 2.0.9,

I find that, in package org.apach.mina.http,
the method parseHttpRequestHead of class HttpServerDecoder use
final String[] header = HEADER_VALUE_PATTERN.split(headerFields[i])
to parse header names and value.

then ,
generalHeaders.put(header[0].toLowerCase(), header[1].trim())
is called to store http headers and values.

However, according to JDK document,
This method works as if by invoking the two-argument split
<http://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html#split%28java.lang.CharSequence,%20int%29>
method with the given input sequence and a limit argument of zero
means,
The result of  input "boo:and:foo" with Regex ":" is { "boo", "and", "foo" }

So. if the values of http header contain the HEADER_VALUE_PATTERN ,which is
":" in class HttpServerDecoder, you may lose something.

Is is a BUG?
Is it better to use HEADER_VALUE_PATTERN.split(headerFields[i],2) instead?

Reply via email to