public Builder(HttpResponse response, Observable<ByteBuf> decoded) { this.status = statusWithCode(response.status().code()); this.version = httpVersion(response.version().toString()); this.headers = response.headers().newBuilder(); this.body = decoded; this.cookies = new ArrayList<>(response.cookies()); }
public static boolean keepAlive(HttpHeaders headers, com.hotels.styx.api.messages.HttpVersion version) { Optional<String> connection = headers.get(CONNECTION); if (connection.isPresent()) { if (CLOSE.toString().equalsIgnoreCase(connection.get())) { return false; } if (KEEP_ALIVE.toString().equalsIgnoreCase(connection.get())) { return true; } } return version.isKeepAliveDefault(); } }
public Builder(FullHttpResponse response, Observable<ByteBuf> body) { this.status = HttpResponseStatus.valueOf(response.status().code()); headers(response.headers().newBuilder()); this.cookies = new ArrayList<>(response.cookies()); version(HttpVersion.valueOf(response.version().toString())); body(body); }
public Builder(com.hotels.styx.api.messages.FullHttpRequest request) { this.id = request.id(); this.secure = request.isSecure(); this.url = request.url(); this.method = HttpMethod.valueOf(request.method().name()); this.cookies = new ArrayList<>(request.cookies()); headers(request.headers().newBuilder()); version(HttpVersion.valueOf(request.version().toString())); }
public Builder(HttpResponse response, byte[] encodedBody) { this.status = statusWithCode(response.status().code()); this.version = httpVersion(response.version().toString()); this.headers = response.headers().newBuilder(); this.body = encodedBody; this.cookies = new ArrayList<>(response.cookies()); }
public Builder(HttpRequest request, byte[] body) { this.id = request.id(); this.method = httpMethod(request.method().name()); this.clientAddress = request.clientAddress(); this.url = request.url(); this.secure = request.isSecure(); this.version = httpVersion(request.version().toString()); this.headers = request.headers().newBuilder(); this.body = body; this.cookies = new ArrayList<>(request.cookies()); }
public Builder(HttpRequest request, Observable<ByteBuf> body) { this.id = request.id(); this.method = httpMethod(request.method().name()); this.clientAddress = request.clientAddress(); this.url = request.url(); this.secure = request.isSecure(); this.version = httpVersion(request.version().toString()); this.headers = request.headers().newBuilder(); this.body = body; this.cookies = new ArrayList<>(request.cookies()); }
Builder(HttpRequest request) { this.id = request.id(); this.method = httpMethod(request.method().name()); this.clientAddress = request.clientAddress(); this.url = request.url(); this.secure = request.isSecure(); this.version = httpVersion(request.version().toString()); this.headers = request.headers().newBuilder(); this.body = request.body().content(); this.cookies = new ArrayList<>(request.cookies()); }