camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jans...@apache.org
Subject svn commit: r1234054 - in /camel/branches/camel-2.9.x: ./ components/camel-http/ components/camel-http/src/main/java/org/apache/camel/component/http/ components/camel-http4/src/main/java/org/apache/camel/component/http4/ components/camel-jetty/src/main...
Date Fri, 20 Jan 2012 18:20:56 GMT
Author: janstey
Date: Fri Jan 20 18:20:56 2012
New Revision: 1234054

URL: http://svn.apache.org/viewvc?rev=1234054&view=rev
Log:
Merged revisions 1234043 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r1234043 | janstey | 2012-01-20 14:35:39 -0330 (Fri, 20 Jan 2012) | 1 line
  
  CAMEL-4926 - disable HTTP TRACE by default
........

Added:
    camel/branches/camel-2.9.x/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyEndpointSetHttpTraceTest.java
      - copied unchanged from r1234043, camel/trunk/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyEndpointSetHttpTraceTest.java
Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/components/camel-http/   (props changed)
    camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java
    camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpConsumer.java
    camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
    camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/CamelServlet.java
    camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpConsumer.java
    camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
    camel/branches/camel-2.9.x/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 20 18:20:56 2012
@@ -1 +1 @@
-/camel/trunk:1227209,1227212,1227540,1228015,1228027,1228223,1228879,1229565,1231135,1231704,1232309,1232312,1232429,1232763,1232782,1232834,1233183,1233259,1233269,1233398,1233442
+/camel/trunk:1227209,1227212,1227540,1228015,1228027,1228223,1228879,1229565,1231135,1231704,1232309,1232312,1232429,1232763,1232782,1232834,1233183,1233259,1233269,1233398,1233442,1234043

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jan 20 18:20:56 2012
@@ -1 +1 @@
-/camel/trunk:1-1227196,1227209,1227212,1227540,1228015,1228027,1228223,1228879,1229565,1231135,1231704,1232309,1232312,1232429,1232763,1232782,1232834,1233183,1233259,1233269,1233398,1233442
+/camel/trunk:1-1227196,1227209,1227212,1227540,1228015,1228027,1228223,1228879,1229565,1231135,1231704,1232309,1232312,1232429,1232763,1232782,1232834,1233183,1233259,1233269,1233398,1233442,1234043

Propchange: camel/branches/camel-2.9.x/components/camel-http/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 20 18:20:56 2012
@@ -1 +1 @@
-/camel/trunk/components/camel-http:917526,1227209,1227212,1228015,1228027,1228223,1228879,1232782,1232834,1233259,1233269
+/camel/trunk/components/camel-http:917526,1227209,1227212,1228015,1228027,1228223,1228879,1232782,1232834,1233259,1233269,1234043

Modified: camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java?rev=1234054&r1=1234053&r2=1234054&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/CamelServlet.java
Fri Jan 20 18:20:56 2012
@@ -63,8 +63,8 @@ public class CamelServlet extends HttpSe
             log.debug("No consumer to service request {}", request);
             response.sendError(HttpServletResponse.SC_NOT_FOUND);
             return;
-        }
-
+        }       
+        
         // are we suspended?
         if (consumer.isSuspended()) {
             log.debug("Consumer suspended, cannot service request {}", request);
@@ -72,6 +72,10 @@ public class CamelServlet extends HttpSe
             return;
         }
 
+        if ("TRACE".equals(request.getMethod()) && !consumer.isTraceEnabled()) {
+            response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+        }
+        
         // create exchange and set data on it
         Exchange exchange = new DefaultExchange(consumer.getEndpoint(), ExchangePattern.InOut);
         if (consumer.getEndpoint().isBridgeEndpoint()) {

Modified: camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpConsumer.java?rev=1234054&r1=1234053&r2=1234054&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpConsumer.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpConsumer.java
Fri Jan 20 18:20:56 2012
@@ -26,9 +26,13 @@ import org.apache.camel.impl.DefaultCons
 public class HttpConsumer extends DefaultConsumer implements SuspendableService {
     private final HttpEndpoint endpoint;
     private volatile boolean suspended;
+    private boolean traceEnabled;
 
     public HttpConsumer(HttpEndpoint endpoint, Processor processor) {
         super(endpoint, processor);
+        if (endpoint.isTraceEnabled()) {
+            setTraceEnabled(true);
+        }
         this.endpoint = endpoint;
     }
 
@@ -71,4 +75,11 @@ public class HttpConsumer extends Defaul
         return suspended;
     }
 
+    public boolean isTraceEnabled() {        
+        return this.traceEnabled;
+    }
+
+    public void setTraceEnabled(boolean traceEnabled) {
+        this.traceEnabled = traceEnabled;
+    }
 }

Modified: camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java?rev=1234054&r1=1234053&r2=1234054&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-http/src/main/java/org/apache/camel/component/http/HttpEndpoint.java
Fri Jan 20 18:20:56 2012
@@ -59,6 +59,7 @@ public class HttpEndpoint extends Defaul
     private int proxyPort;
     private String authMethodPriority;
     private boolean transferException;
+    private boolean traceEnabled;
 
     public HttpEndpoint() {
     }
@@ -319,4 +320,12 @@ public class HttpEndpoint extends Defaul
     public void setTransferException(boolean transferException) {
         this.transferException = transferException;
     }
+
+    public boolean isTraceEnabled() {
+        return this.traceEnabled;
+    }
+
+    public void setTraceEnabled(boolean traceEnabled) {
+        this.traceEnabled = traceEnabled;
+    }
 }

Modified: camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/CamelServlet.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/CamelServlet.java?rev=1234054&r1=1234053&r2=1234054&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/CamelServlet.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/CamelServlet.java
Fri Jan 20 18:20:56 2012
@@ -49,6 +49,10 @@ public class CamelServlet extends HttpSe
                 return;
             }
 
+            if ("TRACE".equals(request.getMethod()) && !consumer.isTraceEnabled())
{
+                response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+            }
+            
             // Have the camel process the HTTP exchange.
             DefaultExchange exchange = new DefaultExchange(consumer.getEndpoint(), ExchangePattern.InOut);
             if (((HttpEndpoint)consumer.getEndpoint()).isBridgeEndpoint()) {

Modified: camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpConsumer.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpConsumer.java?rev=1234054&r1=1234053&r2=1234054&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpConsumer.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpConsumer.java
Fri Jan 20 18:20:56 2012
@@ -25,9 +25,13 @@ import org.apache.camel.impl.DefaultCons
 public class HttpConsumer extends DefaultConsumer {
 
     private final HttpEndpoint endpoint;
+    private boolean traceEnabled;    
 
     public HttpConsumer(HttpEndpoint endpoint, Processor processor) {
         super(endpoint, processor);
+        if (endpoint.isTraceEnabled()) {
+            setTraceEnabled(true);
+        }        
         this.endpoint = endpoint;
     }
 
@@ -55,4 +59,12 @@ public class HttpConsumer extends Defaul
         endpoint.disconnect(this);
         super.doStop();
     }
+
+    public boolean isTraceEnabled() {        
+        return this.traceEnabled;
+    }
+
+    public void setTraceEnabled(boolean traceEnabled) {
+        this.traceEnabled = traceEnabled;
+    }    
 }

Modified: camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java?rev=1234054&r1=1234053&r2=1234054&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-http4/src/main/java/org/apache/camel/component/http4/HttpEndpoint.java
Fri Jan 20 18:20:56 2012
@@ -58,7 +58,8 @@ public class HttpEndpoint extends Defaul
     private boolean chunked = true;
     private boolean disableStreamCache;
     private boolean transferException;
-
+    private boolean traceEnabled;
+    
     public HttpEndpoint() {
     }
 
@@ -310,4 +311,12 @@ public class HttpEndpoint extends Defaul
     public void setTransferException(boolean transferException) {
         this.transferException = transferException;
     }
+    
+    public boolean isTraceEnabled() {
+        return this.traceEnabled;
+    }
+
+    public void setTraceEnabled(boolean traceEnabled) {
+        this.traceEnabled = traceEnabled;
+    }
 }

Modified: camel/branches/camel-2.9.x/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java?rev=1234054&r1=1234053&r2=1234054&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java
(original)
+++ camel/branches/camel-2.9.x/components/camel-jetty/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java
Fri Jan 20 18:20:56 2012
@@ -63,6 +63,10 @@ public class CamelContinuationServlet ex
             return;
         }
 
+        if ("TRACE".equals(request.getMethod()) && !consumer.isTraceEnabled()) {
+            response.sendError(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+        }
+        
         final Exchange result = (Exchange) request.getAttribute(EXCHANGE_ATTRIBUTE_NAME);
         if (result == null) {
             // no asynchronous result so leverage continuation



Mime
View raw message