Overall cleanup of cf4c464d99

This commit is contained in:
Trustin Lee 2014-10-25 16:42:36 +09:00
parent cf4c464d99
commit a653a8ecf4

View File

@ -502,7 +502,11 @@ public abstract class HttpObjectDecoder extends ReplayingDecoder<State> {
do {
char firstChar = line.charAt(0);
if (name != null && (firstChar == ' ' || firstChar == '\t')) {
value = value.toString() + ' ' + line.toString().trim();
StringBuilder buf = new StringBuilder(value.length() + line.length() + 1);
buf.append(value);
buf.append(' ');
buf.append(line.toString().trim());
value = buf.toString();
} else {
if (name != null) {
headers.add(name, value);
@ -732,9 +736,7 @@ public abstract class HttpObjectDecoder extends ReplayingDecoder<State> {
}
protected TooLongFrameException newException(int maxLength) {
return new TooLongFrameException(
"HTTP header is larger than " + maxLength +
" bytes.");
return new TooLongFrameException("HTTP header is larger than " + maxLength + " bytes.");
}
}
@ -752,9 +754,7 @@ public abstract class HttpObjectDecoder extends ReplayingDecoder<State> {
@Override
protected TooLongFrameException newException(int maxLength) {
return new TooLongFrameException(
"An HTTP line is larger than " + maxLength +
" bytes.");
return new TooLongFrameException("An HTTP line is larger than " + maxLength + " bytes.");
}
}
}