getHttpExchange().getProtocol().toUpperCase(Locale.ROOT).equals("HTTP/1.1") ? 1 : 0 );
@Override public String getProtocol() { return delegate.getProtocol(); }
@Override public String getProtocol() { return httpExchange.getProtocol(); }
@Override public String getProtocol() { return httpExchange.getProtocol(); }
@Override public String getProtocol() { return httpExchange.getProtocol(); }
getHttpExchange().getProtocol().toUpperCase(Locale.ENGLISH).equals("HTTP/1.1") ? 1 : 0 );
public Request(HttpExchange exchange, Express express) { this.express = express; this.method = exchange.getRequestMethod(); this.uri = exchange.getRequestURI(); this.headers = exchange.getRequestHeaders(); this.body = exchange.getRequestBody(); this.inet = exchange.getRemoteAddress(); this.protocol = exchange.getProtocol(); this.secure = exchange instanceof HttpsExchange; // Can be suckered? // Parse content length String contentLength = headers.get("Content-Length") != null ? headers.get("Content-Length").get(0) : null; this.contentLength = contentLength != null ? Long.parseLong(contentLength) : -1; // Check if the request contains an body-content this.contentType = headers.get("Content-Type") == null ? "" : headers.get("Content-Type").get(0); // Check if the request has an Authorization header this.auth = Authorization.get(this); // Check if the request contains x-www-form-urlencoded form data this.formQueries = contentType.startsWith("application/x-www-form-urlencoded") ? RequestUtils.parseRawQuery(Utils.streamToString(body)) : new HashMap<>(); // Parse query and cookies, both returns not null if there is nothing this.queries = RequestUtils.parseRawQuery(exchange.getRequestURI().getRawQuery()); this.cookies = RequestUtils.parseCookies(headers); }
ret += exchange.getRequestMethod() + " " + exchange.getRequestURI() + " " + exchange.getProtocol() + "\n";
getHttpExchange().getProtocol().toUpperCase(Locale.ROOT).equals("HTTP/1.1") ? 1 : 0 );