Java Code Examples for io.netty.handler.codec.http.cookie.ServerCookieDecoder#STRICT

The following examples show how to use io.netty.handler.codec.http.cookie.ServerCookieDecoder#STRICT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HttpServerTests.java    From reactor-netty with Apache License 2.0 6 votes vote down vote up
@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();
}
 
Example 2
Source File: HttpServer.java    From reactor-netty with Apache License 2.0 5 votes vote down vote up
/**
 * Configure the
 * {@link ServerCookieEncoder}; {@link ServerCookieDecoder} will be
 * chosen based on the encoder
 *
 * @param encoder the preferred ServerCookieEncoder
 *
 * @return a new {@link HttpServer}
 */
public final HttpServer cookieCodec(ServerCookieEncoder encoder) {
	Objects.requireNonNull(encoder, "encoder");
	ServerCookieDecoder decoder = encoder == ServerCookieEncoder.LAX ?
			ServerCookieDecoder.LAX : ServerCookieDecoder.STRICT;
	HttpServer dup = duplicate();
	dup.configuration().cookieEncoder = encoder;
	dup.configuration().cookieDecoder = decoder;
	return dup;
}
 
Example 3
Source File: HttpServerConfig.java    From reactor-netty with Apache License 2.0 5 votes vote down vote up
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;
}