Exemple #1
0
 private void sendExpect100(Map headers, RequestLine requestLine)
     throws TransformerException, IOException {
   // respond with status code 100, for Expect handshake
   // according to rfc 2616 and http 1.1
   // the processing will continue and the request will be fully
   // read immediately after
   if (HttpConstants.HTTP11.equals(headers.get(HttpConnector.HTTP_VERSION_PROPERTY))) {
     // just in case we have something other than String in
     // the headers map
     String expectHeaderValue =
         ObjectUtils.toString(headers.get(HttpConstants.HEADER_EXPECT)).toLowerCase();
     if (HttpConstants.HEADER_EXPECT_CONTINUE_REQUEST_VALUE.equals(expectHeaderValue)) {
       HttpResponse expected = new HttpResponse();
       expected.setStatusLine(requestLine.getHttpVersion(), HttpConstants.SC_CONTINUE);
       final DefaultMuleEvent event =
           new DefaultMuleEvent(
               new DefaultMuleMessage(expected),
               endpoint,
               new DefaultMuleSession(service, connector.getMuleContext()),
               true);
       RequestContext.setEvent(event);
       conn.writeResponse(transformResponse(expected));
     }
   }
 }
Exemple #2
0
 public static Message failedToCreateAndDispatchResponse(Object object) {
   return factory.createMessage(BUNDLE_PATH, 8, ObjectUtils.toString(object, "null"));
 }