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()); }
private static Info information(HttpRequest request, Origin origin, boolean longFormatEnabled) { Info info = new Info() .add("method", request.method()) .add("secure", request.isSecure()) .add("uri", request.url()) .add("origin", origin != null ? origin.hostAsString() : "N/A"); if (longFormatEnabled) { info.add("headers", request.headers()) .add("cookies", request.cookies()); } return info; }