Example usage for io.vertx.core.http HttpServerOptions setMaxHeaderSize

List of usage examples for io.vertx.core.http HttpServerOptions setMaxHeaderSize

Introduction

In this page you can find the example usage for io.vertx.core.http HttpServerOptions setMaxHeaderSize.

Prototype

public HttpServerOptions setMaxHeaderSize(int maxHeaderSize) 

Source Link

Document

Set the maximum length of all headers for HTTP/1.x .

Usage

From source file:org.apache.servicecomb.transport.rest.vertx.RestServerVerticle.java

License:Apache License

private HttpServerOptions createDefaultHttpServerOptions() {
    HttpServerOptions serverOptions = new HttpServerOptions();
    serverOptions.setUsePooledBuffers(true);
    serverOptions.setIdleTimeout(TransportConfig.getConnectionIdleTimeoutInSeconds());
    serverOptions.setCompressionSupported(TransportConfig.getCompressed());
    serverOptions.setMaxHeaderSize(TransportConfig.getMaxHeaderSize());
    serverOptions.setMaxInitialLineLength(TransportConfig.getMaxInitialLineLength());
    if (endpointObject.isHttp2Enabled()) {
        serverOptions.setUseAlpn(TransportConfig.getUseAlpn()).setInitialSettings(
                new Http2Settings().setMaxConcurrentStreams(TransportConfig.getMaxConcurrentStreams()));
    }/*w w  w  .ja  va  2s. com*/
    if (endpointObject.isSslEnabled()) {
        SSLOptionFactory factory = SSLOptionFactory.createSSLOptionFactory(SSL_KEY, null);
        SSLOption sslOption;
        if (factory == null) {
            sslOption = SSLOption.buildFromYaml(SSL_KEY);
        } else {
            sslOption = factory.createSSLOption();
        }
        SSLCustom sslCustom = SSLCustom.createSSLCustom(sslOption.getSslCustomClass());
        VertxTLSBuilder.buildNetServerOptions(sslOption, sslCustom, serverOptions);
    }

    return serverOptions;
}