Examples of HttpField


Examples of org.eclipse.jetty.http.HttpField

        this.connectionFactory = connectionFactory;

        String host = getHost();
        if (!client.isDefaultPort(getScheme(), getPort()))
            host += ":" + getPort();
        hostField = new HttpField(HttpHeader.HOST, host);
    }
View Full Code Here

Examples of org.eclipse.jetty.http.HttpField

        fcgiHeaders.put(FCGI.Headers.DOCUMENT_URI, path);
        String query = uri.getRawQuery();
        fcgiHeaders.put(FCGI.Headers.QUERY_STRING, query == null ? "" : query);

        // FastCGI headers based on HTTP headers
        HttpField httpField = headers.remove(HttpHeader.AUTHORIZATION);
        if (httpField != null)
            fcgiHeaders.put(FCGI.Headers.AUTH_TYPE, httpField.getValue());
        httpField = headers.remove(HttpHeader.CONTENT_LENGTH);
        fcgiHeaders.put(FCGI.Headers.CONTENT_LENGTH, httpField == null ? "" : httpField.getValue());
        httpField = headers.remove(HttpHeader.CONTENT_TYPE);
        fcgiHeaders.put(FCGI.Headers.CONTENT_TYPE, httpField == null ? "" : httpField.getValue());

        // FastCGI headers that are not based on HTTP headers nor URI
        fcgiHeaders.put(FCGI.Headers.REQUEST_METHOD, request.getMethod());
        fcgiHeaders.put(FCGI.Headers.SERVER_PROTOCOL, request.getVersion().asString());
        fcgiHeaders.put(FCGI.Headers.GATEWAY_INTERFACE, "CGI/1.1");
View Full Code Here

Examples of org.eclipse.jetty.http.HttpField

            synchronized (this) // Trade some contention for less garbage
            {
                df = _dateField;
                if (df==null || df._seconds!=seconds)
                {
                    HttpField field=new PreEncodedHttpField(HttpHeader.DATE,DateGenerator.formatDate(now));
                    _dateField=new DateField(seconds,field);
                    return field;
                }
            }
        }
View Full Code Here

Examples of org.eclipse.jetty.http.HttpField

    /* ------------------------------------------------------------ */
    private String findServerName()
    {
        // Return host from header field
        HttpField host = _metadata.getFields().getField(HttpHeader.HOST);
        if (host!=null)
        {
            // TODO is this needed now?
            HostPortHttpField authority = (host instanceof HostPortHttpField)
                ?((HostPortHttpField)host)
                :new HostPortHttpField(host.getValue());
            _metadata.getURI().setAuthority(authority.getHost(),authority.getPort());
            return authority.getHost();
        }

        // Return host from connection
View Full Code Here

Examples of org.eclipse.jetty.http.HttpField

    /* ------------------------------------------------------------ */
    private int findServerPort()
    {
        // Return host from header field
        HttpField host = _metadata.getFields().getField(HttpHeader.HOST);
        if (host!=null)
        {
            // TODO is this needed now?
            HostPortHttpField authority = (host instanceof HostPortHttpField)
                ?((HostPortHttpField)host)
                :new HostPortHttpField(host.getValue());
            _metadata.getURI().setAuthority(authority.getHost(),authority.getPort());
            return authority.getPort();
        }

        // Return host from connection
View Full Code Here

Examples of org.eclipse.jetty.http.HttpField

            processField(field);
    }

    private void processField(HttpField field)
    {
        HttpField httpField = convertHeader(field);
        if (httpField != null)
        {
            fields.add(httpField);
            if (HttpHeader.HOST.is(httpField.getName()))
                hostPort = (HostPortHttpField)httpField;
        }
    }
View Full Code Here

Examples of org.eclipse.jetty.http.HttpField

            }
            String headerName = httpName.toString();
            if (HttpHeader.HOST.is(headerName))
                return new HostPortHttpField(field.getValue());
            else
                return new HttpField(httpName.toString(), field.getValue());
        }
        return null;
    }
View Full Code Here

Examples of org.eclipse.jetty.http.HttpField

        path = uri.getRawPath();
        query = uri.getRawQuery();
        extractParams(query);
        followRedirects(client.isFollowRedirects());
        idleTimeout = client.getIdleTimeout();
        HttpField acceptEncodingField = client.getAcceptEncodingField();
        if (acceptEncodingField != null)
            headers.put(acceptEncodingField);
        HttpField userAgentField = client.getUserAgentField();
        if (userAgentField != null)
            headers.put(userAgentField);
    }
View Full Code Here

Examples of org.eclipse.jetty.http.HttpField

    protected void onParam(String name, String value)
    {
        try
        {
            listener.onHeader(getRequest(), new HttpField(name, value));
        }
        catch (Throwable x)
        {
            if (LOG.isDebugEnabled())
                LOG.debug("Exception while invoking listener " + listener, x);
View Full Code Here

Examples of org.eclipse.jetty.http.HttpField

                    ContentDecoder.Factory decoderFactory = iterator.next();
                    value.append(decoderFactory.getEncoding());
                    if (iterator.hasNext())
                        value.append(",");
                }
                encodingField = new HttpField(HttpHeader.ACCEPT_ENCODING, value.toString());
            }
        }
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.