Examples of HttpVersion


Examples of com.facebook.presto.jdbc.internal.jetty.http.HttpVersion

    protected abstract void send(HttpExchange exchange);

    protected void normalizeRequest(Request request)
    {
        String method = request.getMethod();
        HttpVersion version = request.getVersion();
        HttpFields headers = request.getHeaders();
        ContentProvider content = request.getContent();
        ProxyConfiguration.Proxy proxy = destination.getProxy();

        // Make sure the path is there
        String path = request.getPath();
        if (path.trim().length() == 0)
        {
            path = "/";
            request.path(path);
        }
        if (proxy != null && !HttpMethod.CONNECT.is(method))
        {
            path = request.getURI().toString();
            request.path(path);
        }

        // If we are HTTP 1.1, add the Host header
        if (version.getVersion() > 10)
        {
            if (!headers.containsKey(HttpHeader.HOST.asString()))
                headers.put(getHttpDestination().getHostField());
        }
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.netty.handler.codec.http.HttpVersion

        text = text.trim().toUpperCase();
        if ("RTSP/1.0".equals(text)) {
            return RTSP_1_0;
        }

        return new HttpVersion(text, true);
    }
View Full Code Here

Examples of com.ramforth.webserver.http.HttpVersion

            catch (URISyntaxException e) {
                throw new HttpException(HttpStatusCode.STATUS_400_BAD_REQUEST, "URI '" + uriString + "' not valid!");
            }

            if (versionString.compareTo(HttpUtils.httpVersion(1, 0)) == 0) {
                version = new HttpVersion(1, 0);
            } else if (versionString.compareTo(HttpUtils.httpVersion(1, 1)) == 0) {
                version = new HttpVersion(1, 1);
            } else {
                throw new HttpException(HttpStatusCode.STATUS_505_HTTP_VERSION_NOT_SUPPORTED, "Version '" + versionString + "' not supported!");
            }
        } else {
            throw new HttpException(HttpStatusCode.STATUS_400_BAD_REQUEST, "Request line '" + requestLine + "' invalid!");
View Full Code Here

Examples of io.netty.handler.codec.http.HttpVersion

        bytesSent.addAndGet(bytesWritten);
        return bytesSent.get() >= config.maxStreamingBytesSize();
    }

    protected HttpResponse createResponse(String contentType) {
        final HttpVersion version = request.getProtocolVersion();
        HttpResponse response = new DefaultHttpResponse(version, HttpResponseStatus.OK);
        if (request.getProtocolVersion().equals(HttpVersion.HTTP_1_1)) {
            response.headers().set(TRANSFER_ENCODING, HttpHeaders.Values.CHUNKED);
        }
        response.headers().set(CONTENT_TYPE, contentType);
View Full Code Here

Examples of org.apache.commons.httpclient.HttpVersion

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            RequestLine requestLine = request.getRequestLine();
            HttpVersion ver = requestLine.getHttpVersion();
            Header auth = request.getFirstHeader("Authorization");
            if (auth == null) {
                response.setStatusLine(ver, HttpStatus.SC_UNAUTHORIZED);
                response.addHeader(new Header("WWW-Authenticate",
                        "Digest realm=\"realm1\", nonce=\"ABC123\""));
View Full Code Here

Examples of org.apache.commons.httpclient.HttpVersion

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            String uri = request.getRequestLine().getUri()
            HttpVersion httpversion = request.getRequestLine().getHttpVersion();
           
            if ("/miss/".equals(uri)) {
                response.setStatusLine(httpversion, HttpStatus.SC_MOVED_TEMPORARILY);
                response.addHeader(new Header("Location", "/hit/"));
                response.setBodyString("Missed!");
View Full Code Here

Examples of org.apache.commons.httpclient.HttpVersion

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            RequestLine requestLine = request.getRequestLine();
            HttpVersion ver = requestLine.getHttpVersion();
            Header auth = request.getFirstHeader("Authorization");
            if (auth == null) {
                response.setStatusLine(ver, HttpStatus.SC_UNAUTHORIZED);
                response.addHeader(new Header("WWW-Authenticate",
                        "Digest realm=\"realm1\", nonce=\"ABC123\""));
View Full Code Here

Examples of org.apache.commons.httpclient.HttpVersion

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            String uri = request.getRequestLine().getUri()
            HttpVersion httpversion = request.getRequestLine().getHttpVersion();
           
            if ("/miss/".equals(uri)) {
                response.setStatusLine(httpversion, HttpStatus.SC_MOVED_TEMPORARILY);
                response.addHeader(new Header("Location", "/hit/"));
                response.setBodyString("Missed!");
View Full Code Here

Examples of org.apache.commons.httpclient.HttpVersion

        }

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            HttpVersion ver = request.getRequestLine().getHttpVersion();
            response.setStatusLine(ver, HttpStatus.SC_OK);
            response.addHeader(new Header("Connection", "close"));
            response.addHeader(new Header("Set-Cookie",
                "custno = 12345; comment=test; version=1," +
                " name=John; version=1; max-age=600; secure; domain=.apache.org"));
View Full Code Here

Examples of org.apache.commons.httpclient.HttpVersion

        public boolean process(final SimpleRequest request, final SimpleResponse response)
            throws IOException
        {
            RequestLine requestLine = request.getRequestLine();
            HttpVersion ver = requestLine.getHttpVersion();
            Header auth = request.getFirstHeader("Authorization");
            if (auth == null) {
                response.setStatusLine(ver, HttpStatus.SC_UNAUTHORIZED);
                response.addHeader(new Header("WWW-Authenticate", "NTLM"));
                response.setBodyString("Authorization required");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.