Example usage for io.vertx.core.http HttpVersion HTTP_1_0

List of usage examples for io.vertx.core.http HttpVersion HTTP_1_0

Introduction

In this page you can find the example usage for io.vertx.core.http HttpVersion HTTP_1_0.

Prototype

HttpVersion HTTP_1_0

To view the source code for io.vertx.core.http HttpVersion HTTP_1_0.

Click Source Link

Usage

From source file:io.apiman.gateway.platforms.vertx3.http.HttpApiFactory.java

License:Apache License

public static void buildResponse(HttpServerResponse httpServerResponse, ApiResponse amanResponse,
        HttpVersion httpVersion) {/*w w w .  ja  v a2  s .  c o  m*/
    amanResponse.getHeaders().forEach(e -> {
        if (httpVersion == HttpVersion.HTTP_1_0 || httpVersion == HttpVersion.HTTP_1_1
                || !e.getKey().equals("Connection")) {
            httpServerResponse.headers().add(e.getKey(), e.getValue());
        }
    });
    httpServerResponse.setStatusCode(amanResponse.getCode());
    httpServerResponse.setStatusMessage(amanResponse.getMessage());
}