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

The following examples show how to use io.netty.handler.codec.http.cookie.ClientCookieEncoder#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: HttpClientConfig.java    From reactor-netty with Apache License 2.0 5 votes vote down vote up
HttpClientConfig(ConnectionProvider connectionProvider, Map<ChannelOption<?>, ?> options,
		Supplier<? extends SocketAddress> remoteAddress) {
	super(connectionProvider, options, remoteAddress);
	this.acceptGzip = false;
	this.cookieDecoder = ClientCookieDecoder.STRICT;
	this.cookieEncoder = ClientCookieEncoder.STRICT;
	this.decoder = new HttpResponseDecoderSpec();
	this.headers = new DefaultHttpHeaders();
	this.method = HttpMethod.GET;
	this.protocols = new HttpProtocol[]{HttpProtocol.HTTP11};
	this._protocols = h11;
	this.retryDisabled = false;
}
 
Example 2
Source File: HttpClientOperationsTest.java    From reactor-netty with Apache License 2.0 5 votes vote down vote up
@Test
public void testConstructorWithProvidedReplacement() {
	EmbeddedChannel channel = new EmbeddedChannel();
	channel.pipeline().addFirst(NettyPipeline.SslHandler, new ChannelHandlerAdapter() {
	});

	HttpClientOperations ops1 = new HttpClientOperations(() -> channel,
			ConnectionObserver.emptyListener(),
			ClientCookieEncoder.STRICT, ClientCookieDecoder.STRICT);
	ops1.followRedirectPredicate((req, res) -> true);
	ops1.started = true;
	ops1.retrying = true;
	ops1.redirecting = new RedirectClientException(new DefaultHttpHeaders().add(HttpHeaderNames.LOCATION, "/"));

	HttpClientOperations ops2 = new HttpClientOperations(ops1);

	assertSame(ops1.channel(), ops2.channel());
	assertSame(ops1.started, ops2.started);
	assertSame(ops1.retrying, ops2.retrying);
	assertSame(ops1.redirecting, ops2.redirecting);
	assertSame(ops1.redirectedFrom, ops2.redirectedFrom);
	assertSame(ops1.isSecure, ops2.isSecure);
	assertSame(ops1.nettyRequest, ops2.nettyRequest);
	assertSame(ops1.responseState, ops2.responseState);
	assertSame(ops1.followRedirectPredicate, ops2.followRedirectPredicate);
	assertSame(ops1.requestHeaders, ops2.requestHeaders);
}
 
Example 3
Source File: HttpClientOperationsTest.java    From reactor-netty with Apache License 2.0 5 votes vote down vote up
private void doTestStatus(HttpResponseStatus status) {
	EmbeddedChannel channel = new EmbeddedChannel();
	HttpClientOperations ops = new HttpClientOperations(() -> channel,
			ConnectionObserver.emptyListener(),
			ClientCookieEncoder.STRICT, ClientCookieDecoder.STRICT);
	ops.setNettyResponse(new DefaultFullHttpResponse(HTTP_1_1, status, Unpooled.EMPTY_BUFFER));
	assertEquals(status.reasonPhrase(), ops.status().reasonPhrase());
}