CRLF -> CR + LF
This commit is contained in:
parent
bb0c1e139f
commit
7e3358f0f3
@ -73,7 +73,8 @@ public abstract class HttpMessageEncoder extends OneToOneEncoder {
|
|||||||
channel.getConfig().getBufferFactory());
|
channel.getConfig().getBufferFactory());
|
||||||
encodeInitialLine(header, m);
|
encodeInitialLine(header, m);
|
||||||
encodeHeaders(header, m);
|
encodeHeaders(header, m);
|
||||||
header.writeBytes(CRLF);
|
header.writeByte(CR);
|
||||||
|
header.writeByte(LF);
|
||||||
|
|
||||||
ChannelBuffer content = m.getContent();
|
ChannelBuffer content = m.getContent();
|
||||||
if (!content.readable()) {
|
if (!content.readable()) {
|
||||||
@ -96,9 +97,11 @@ public abstract class HttpMessageEncoder extends OneToOneEncoder {
|
|||||||
ChannelBuffer trailer = ChannelBuffers.dynamicBuffer(
|
ChannelBuffer trailer = ChannelBuffers.dynamicBuffer(
|
||||||
channel.getConfig().getBufferFactory());
|
channel.getConfig().getBufferFactory());
|
||||||
trailer.writeByte((byte) '0');
|
trailer.writeByte((byte) '0');
|
||||||
trailer.writeBytes(CRLF);
|
trailer.writeByte(CR);
|
||||||
|
trailer.writeByte(LF);
|
||||||
encodeTrailingHeaders(trailer, (HttpChunkTrailer) chunk);
|
encodeTrailingHeaders(trailer, (HttpChunkTrailer) chunk);
|
||||||
trailer.writeBytes(CRLF);
|
trailer.writeByte(CR);
|
||||||
|
trailer.writeByte(LF);
|
||||||
return trailer;
|
return trailer;
|
||||||
} else {
|
} else {
|
||||||
return LAST_CHUNK.duplicate();
|
return LAST_CHUNK.duplicate();
|
||||||
@ -155,7 +158,8 @@ public abstract class HttpMessageEncoder extends OneToOneEncoder {
|
|||||||
buf.writeByte(COLON);
|
buf.writeByte(COLON);
|
||||||
buf.writeByte(SP);
|
buf.writeByte(SP);
|
||||||
buf.writeBytes(value.getBytes("ASCII"));
|
buf.writeBytes(value.getBytes("ASCII"));
|
||||||
buf.writeBytes(CRLF);
|
buf.writeByte(CR);
|
||||||
|
buf.writeByte(LF);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void encodeInitialLine(ChannelBuffer buf, HttpMessage message) throws Exception;
|
protected abstract void encodeInitialLine(ChannelBuffer buf, HttpMessage message) throws Exception;
|
||||||
|
@ -45,6 +45,7 @@ public class HttpRequestEncoder extends HttpMessageEncoder {
|
|||||||
buf.writeBytes(request.getUri().getBytes("ASCII"));
|
buf.writeBytes(request.getUri().getBytes("ASCII"));
|
||||||
buf.writeByte(SP);
|
buf.writeByte(SP);
|
||||||
buf.writeBytes(request.getProtocolVersion().toString().getBytes("ASCII"));
|
buf.writeBytes(request.getProtocolVersion().toString().getBytes("ASCII"));
|
||||||
buf.writeBytes(CRLF);
|
buf.writeByte(CR);
|
||||||
|
buf.writeByte(LF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ public class HttpResponseEncoder extends HttpMessageEncoder {
|
|||||||
buf.writeBytes(String.valueOf(response.getStatus().getCode()).getBytes("ASCII"));
|
buf.writeBytes(String.valueOf(response.getStatus().getCode()).getBytes("ASCII"));
|
||||||
buf.writeByte(SP);
|
buf.writeByte(SP);
|
||||||
buf.writeBytes(String.valueOf(response.getStatus().getReasonPhrase()).getBytes("ASCII"));
|
buf.writeBytes(String.valueOf(response.getStatus().getReasonPhrase()).getBytes("ASCII"));
|
||||||
buf.writeBytes(CRLF);
|
buf.writeByte(CR);
|
||||||
|
buf.writeByte(LF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user