@Override public io.vertx.core.http.HttpVersion version() { if (version == null) { io.netty.handler.codec.http.HttpVersion nettyVersion = request.protocolVersion(); if (nettyVersion == io.netty.handler.codec.http.HttpVersion.HTTP_1_0) { version = HttpVersion.HTTP_1_0; } else if (nettyVersion == io.netty.handler.codec.http.HttpVersion.HTTP_1_1) { version = HttpVersion.HTTP_1_1; } else { sendNotImplementedAndClose(); throw new IllegalStateException("Unsupported HTTP version: " + nettyVersion); } } return version; }
HttpServerResponseImpl(final VertxInternal vertx, Http1xServerConnection conn, DefaultHttpRequest request, Object requestMetric) { this.vertx = vertx; this.conn = conn; this.version = request.protocolVersion(); this.headers = new VertxHttpHeaders(); this.status = HttpResponseStatus.OK; this.requestMetric = requestMetric; this.keepAlive = (version == HttpVersion.HTTP_1_1 && !request.headers().contains(io.vertx.core.http.HttpHeaders.CONNECTION, HttpHeaders.CLOSE, true)) || (version == HttpVersion.HTTP_1_0 && request.headers().contains(io.vertx.core.http.HttpHeaders.CONNECTION, HttpHeaders.KEEP_ALIVE, true)); this.head = request.method() == io.netty.handler.codec.http.HttpMethod.HEAD; }
DefaultHttpRequest nettyReq = req.getRequest(); nettyReq = new DefaultFullHttpRequest( nettyReq.protocolVersion(), nettyReq.method(), nettyReq.uri(),
@Override public io.vertx.core.http.HttpVersion version() { if (version == null) { io.netty.handler.codec.http.HttpVersion nettyVersion = request.protocolVersion(); if (nettyVersion == io.netty.handler.codec.http.HttpVersion.HTTP_1_0) { version = HttpVersion.HTTP_1_0; } else if (nettyVersion == io.netty.handler.codec.http.HttpVersion.HTTP_1_1) { version = HttpVersion.HTTP_1_1; } else { sendNotImplementedAndClose(); throw new IllegalStateException("Unsupported HTTP version: " + nettyVersion); } } return version; }
HttpServerResponseImpl(final VertxInternal vertx, Http1xServerConnection conn, DefaultHttpRequest request, Object requestMetric) { this.vertx = vertx; this.conn = conn; this.version = request.protocolVersion(); this.headers = new VertxHttpHeaders(); this.status = HttpResponseStatus.OK; this.requestMetric = requestMetric; this.keepAlive = (version == HttpVersion.HTTP_1_1 && !request.headers().contains(io.vertx.core.http.HttpHeaders.CONNECTION, HttpHeaders.CLOSE, true)) || (version == HttpVersion.HTTP_1_0 && request.headers().contains(io.vertx.core.http.HttpHeaders.CONNECTION, HttpHeaders.KEEP_ALIVE, true)); this.head = request.method() == io.netty.handler.codec.http.HttpMethod.HEAD; }
DefaultHttpRequest nettyReq = req.getRequest(); nettyReq = new DefaultFullHttpRequest( nettyReq.protocolVersion(), nettyReq.method(), nettyReq.uri(),