Skip to content

Commit

Permalink
Use the new Transport API for HttpServer
Browse files Browse the repository at this point in the history
  • Loading branch information
violetagg committed Apr 24, 2020
1 parent e215f1b commit 609d96e
Show file tree
Hide file tree
Showing 10 changed files with 1,022 additions and 1,536 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
*/
package reactor.netty.http.server;

import java.util.function.Function;

import reactor.netty.http.HttpDecoderSpec;
import reactor.netty.tcp.TcpServer;

/**
* A configuration builder to fine tune the {@link io.netty.handler.codec.http.HttpServerCodec}
Expand All @@ -37,17 +34,16 @@ public HttpRequestDecoderSpec get() {
}

/**
* Build a {@link Function} that applies the http request decoder configuration to a
* {@link TcpServer} by enriching its attributes.
* Build a {@link HttpRequestDecoderSpec}.
*/
Function<TcpServer, TcpServer> build() {
HttpRequestDecoderSpec build() {
HttpRequestDecoderSpec decoder = new HttpRequestDecoderSpec();
decoder.initialBufferSize = initialBufferSize;
decoder.maxChunkSize = maxChunkSize;
decoder.maxHeaderSize = maxHeaderSize;
decoder.maxInitialLineLength = maxInitialLineLength;
decoder.validateHeaders = validateHeaders;
return tcp -> tcp.bootstrap(b -> HttpServerConfiguration.decoder(b, decoder));
return decoder;
}

}
Loading

0 comments on commit 609d96e

Please sign in to comment.