下面列出了 io.netty.handler.codec.http.cookie.ServerCookieEncoder # STRICT 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@SuppressWarnings("FutureReturnValueIgnored")
private void doTestStatus(HttpResponseStatus status) {
EmbeddedChannel channel = new EmbeddedChannel();
HttpServerOperations ops = new HttpServerOperations(
Connection.from(channel),
ConnectionObserver.emptyListener(),
null,
new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/"),
null,
ServerCookieEncoder.STRICT,
ServerCookieDecoder.STRICT);
ops.status(status);
HttpMessage response = ops.newFullBodyMessage(Unpooled.EMPTY_BUFFER);
assertThat(((FullHttpResponse) response).status().reasonPhrase()).isEqualTo(status.reasonPhrase());
// "FutureReturnValueIgnored" is suppressed deliberately
channel.close();
}
HttpServerConfig(Map<ChannelOption<?>, ?> options, Map<ChannelOption<?>, ?> childOptions, Supplier<? extends SocketAddress> localAddress) {
super(options, childOptions, localAddress);
this.cookieDecoder = ServerCookieDecoder.STRICT;
this.cookieEncoder = ServerCookieEncoder.STRICT;
this.decoder = new HttpRequestDecoderSpec();
this.forwarded = false;
this.minCompressionSize = -1;
this.protocols = new HttpProtocol[]{HttpProtocol.HTTP11};
this._protocols = h11;
this.proxyProtocolSupportType = ProxyProtocolSupportType.OFF;
}