Examples of HttpFields


Examples of org.mortbay.jetty.HttpFields

        assertEquals(HttpHeaderValues.CLOSE, _response.getHeader(HttpHeaders.CONNECTION));
    }
   
    public void testWinVistaWithIE6() throws Exception
    {
        HttpFields fields = _connection.getRequestFields();
        fields.add("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 6.0)");
       
        String result = _rule.matchAndApply(_request.getRequestURI(), _request, _response);
       
        assertEquals(null, result);
        assertEquals(null, _response.getHeader(HttpHeaders.CONNECTION));
View Full Code Here

Examples of org.mortbay.jetty.HttpFields

        assertEquals(null, _response.getHeader(HttpHeaders.CONNECTION));
    }
   
    public void testWinVistaWithIE7() throws Exception
    {
        HttpFields fields = _connection.getRequestFields();
        fields.add("User-Agent", "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)");
       
        String result = _rule.matchAndApply(_request.getRequestURI(), _request, _response);
       
        assertEquals(null, result);
        assertEquals(null, _response.getHeader(HttpHeaders.CONNECTION));
View Full Code Here

Examples of org.openqa.jetty.http.HttpFields

        // if browser closes stream, we should detect it and kill process...
        try
        {
            // read any headers off the top of our input stream
            LineInput li = new LineInput(p.getInputStream());
            HttpFields fields=new HttpFields();
            fields.read(li);

            String ContentStatus = "Status";
            String redirect = fields.get(HttpFields.__Location);
            String status   = fields.get(ContentStatus);

            if (status!=null)
            {
                log.debug("Found a Status header - setting status on response");
                fields.remove(ContentStatus);

                // NOTE: we ignore any reason phrase, otherwise we
                // would need to use res.sendError() selectively.
                int i = status.indexOf(' ');
                if (i>0)
                    status = status.substring(0,i);

                res.setStatus(Integer.parseInt(status));
            }

            // copy remaining headers into response...
      for (Iterator i=fields.iterator(); i.hasNext();)
            {
                HttpFields.Entry e=(HttpFields.Entry)i.next();
                res.addHeader(e.getKey(),e.getValue());
            }
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.