public boolean greaterEquals(final ProtocolVersion protocolVersion) { return version.greaterEquals(protocolVersion); }
@Override HttpRoute determineRoute(final HttpRequest request, final HttpClientContext clientContext) throws HttpException { final HttpRoute route = routePlanner.determineRoute(RoutingSupport.determineHost(request), clientContext); final ProtocolVersion protocolVersion = clientContext.getProtocolVersion(); if (route.isTunnelled() && protocolVersion.greaterEquals(HttpVersion.HTTP_2_0)) { throw new HttpException("HTTP/2 tunneling not supported"); } return route; }
if (ver.greaterEquals(HttpVersion.HTTP_1_1)) { final Iterator<String> it = new BasicTokenIterator(headerIterator); while (it.hasNext()) { return ver.greaterEquals(HttpVersion.HTTP_1_1);
if (ver.greaterEquals(HttpVersion.HTTP_1_1)) { final Iterator<String> it = new BasicTokenIterator(headerIterator); while (it.hasNext()) { return ver.greaterEquals(HttpVersion.HTTP_1_1);
@Override public void process(final HttpRequest request, final EntityDetails entity, final HttpContext context) throws HttpException, IOException { Args.notNull(request, "HTTP request"); final Header header = request.getHeader(HttpHeaders.HOST); if (header != null) { final URIAuthority authority; try { authority = URIAuthority.create(header.getValue()); } catch (final URISyntaxException ex) { throw new ProtocolException(ex.getMessage(), ex); } request.setAuthority(authority); } else { final ProtocolVersion version = request.getVersion() != null ? request.getVersion() : HttpVersion.HTTP_1_1; if (version.greaterEquals(HttpVersion.HTTP_1_1)) { throw new ProtocolException("Host header is absent"); } } }
@Override public void process(final HttpRequest request, final EntityDetails entity, final HttpContext context) throws HttpException, IOException { Args.notNull(request, "HTTP request"); final Header header = request.getHeader(HttpHeaders.HOST); if (header != null) { final URIAuthority authority; try { authority = URIAuthority.create(header.getValue()); } catch (final URISyntaxException ex) { throw new ProtocolException(ex.getMessage(), ex); } request.setAuthority(authority); } else { final ProtocolVersion version = request.getVersion() != null ? request.getVersion() : HttpVersion.HTTP_1_1; if (version.greaterEquals(HttpVersion.HTTP_1_1)) { throw new ProtocolException("Host header is absent"); } } }
@Override public ClassicHttpRequest receiveRequestHeader() throws HttpException, IOException { final SocketHolder socketHolder = ensureOpen(); final ClassicHttpRequest request = this.requestParser.parse(this.inBuffer, socketHolder.getInputStream()); final ProtocolVersion transportVersion = request.getVersion(); if (transportVersion != null && transportVersion.greaterEquals(HttpVersion.HTTP_2)) { throw new UnsupportedHttpVersionException(transportVersion); } request.setScheme(this.scheme); this.version = transportVersion; onRequestReceived(request); incrementRequestCount(); return request; }
@Override public ClassicHttpRequest receiveRequestHeader() throws HttpException, IOException { final SocketHolder socketHolder = ensureOpen(); final ClassicHttpRequest request = this.requestParser.parse(this.inBuffer, socketHolder.getInputStream()); final ProtocolVersion transportVersion = request.getVersion(); if (transportVersion != null && transportVersion.greaterEquals(HttpVersion.HTTP_2)) { throw new UnsupportedHttpVersionException(transportVersion); } request.setScheme(this.scheme); this.version = transportVersion; onRequestReceived(request); incrementRequestCount(); return request; }
if (transportVersion != null && transportVersion.greaterEquals(HttpVersion.HTTP_2)) { throw new UnsupportedHttpVersionException(transportVersion);
if (transportVersion != null && transportVersion.greaterEquals(HttpVersion.HTTP_2)) { throw new UnsupportedHttpVersionException(transportVersion);
private void commitRequest(final HttpRequest request, final EntityDetails entityDetails) throws IOException, HttpException { if (requestCommitted.compareAndSet(false, true)) { final ProtocolVersion transportVersion = request.getVersion(); if (transportVersion != null && transportVersion.greaterEquals(HttpVersion.HTTP_2)) { throw new UnsupportedHttpVersionException(transportVersion);
private void commitRequest(final HttpRequest request, final EntityDetails entityDetails) throws IOException, HttpException { if (requestCommitted.compareAndSet(false, true)) { final ProtocolVersion transportVersion = request.getVersion(); if (transportVersion != null && transportVersion.greaterEquals(HttpVersion.HTTP_2)) { throw new UnsupportedHttpVersionException(transportVersion);
@Override public ClassicHttpResponse receiveResponseHeader() throws HttpException, IOException { final SocketHolder socketHolder = ensureOpen(); final ClassicHttpResponse response = this.responseParser.parse(this.inBuffer, socketHolder.getInputStream()); final ProtocolVersion transportVersion = response.getVersion(); if (transportVersion != null && transportVersion.greaterEquals(HttpVersion.HTTP_2)) { throw new UnsupportedHttpVersionException(transportVersion); } this.version = transportVersion; onResponseReceived(response); final int status = response.getCode(); if (status < HttpStatus.SC_INFORMATIONAL) { throw new ProtocolException("Invalid response: " + status); } if (response.getCode() >= HttpStatus.SC_SUCCESS) { incrementResponseCount(); } return response; }
@Override public ClassicHttpResponse receiveResponseHeader() throws HttpException, IOException { final SocketHolder socketHolder = ensureOpen(); final ClassicHttpResponse response = this.responseParser.parse(this.inBuffer, socketHolder.getInputStream()); final ProtocolVersion transportVersion = response.getVersion(); if (transportVersion != null && transportVersion.greaterEquals(HttpVersion.HTTP_2)) { throw new UnsupportedHttpVersionException(transportVersion); } this.version = transportVersion; onResponseReceived(response); final int status = response.getCode(); if (status < HttpStatus.SC_INFORMATIONAL) { throw new ProtocolException("Invalid response: " + status); } if (response.getCode() >= HttpStatus.SC_SUCCESS) { incrementResponseCount(); } return response; }
if (transportVersion != null && transportVersion.greaterEquals(HttpVersion.HTTP_2)) { throw new UnsupportedHttpVersionException(transportVersion);
if (transportVersion != null && transportVersion.greaterEquals(HttpVersion.HTTP_2)) { throw new UnsupportedHttpVersionException(transportVersion);
if (transportVersion != null && transportVersion.greaterEquals(HttpVersion.HTTP_2)) { throw new UnsupportedHttpVersionException(transportVersion);
if (transportVersion != null && transportVersion.greaterEquals(HttpVersion.HTTP_2)) { throw new UnsupportedHttpVersionException(transportVersion);
if (len >= 0 && !entity.isChunked()) { response.addHeader(HttpHeaders.CONTENT_LENGTH, Long.toString(entity.getContentLength())); } else if (ver.greaterEquals(HttpVersion.HTTP_1_1)) { response.addHeader(HttpHeaders.TRANSFER_ENCODING, HeaderElements.CHUNKED_ENCODING); MessageSupport.addTrailerHeader(response, entity);
if (len >= 0 && !entity.isChunked()) { response.addHeader(HttpHeaders.CONTENT_LENGTH, Long.toString(entity.getContentLength())); } else if (ver.greaterEquals(HttpVersion.HTTP_1_1)) { response.addHeader(HttpHeaders.TRANSFER_ENCODING, HeaderElements.CHUNKED_ENCODING); MessageSupport.addTrailerHeader(response, entity);