Claus Ibsen created CAMEL-27903:
-----------------------------------

             Summary: camel-servlet: transferException needs 
muteException=false, async and httpConfiguration have no effect, 
httpMethodRestrict is a substring match
                 Key: CAMEL-27903
                 URL: https://issues.apache.org/jira/browse/CAMEL-27903
             Project: Camel
          Issue Type: Bug
          Components: camel-servlet
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-servlet for CAMEL-23832 
(pull request https://github.com/apache/camel/pull/31165).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. transferException has no effect while muteException is on
{{DefaultHttpBinding.doWriteExceptionResponse}} (camel-http-common) checks 
muteException before transferException; muteException defaults to true, so 
transferException=true does nothing unless muteException=false is set too 
(servlet and jetty).
Proposed change: let transferException take precedence, or document it in the 
upgrade guide.

h4. 2. async has no effect
{{ServletComponent.createEndpoint}} sets async on the endpoint, but nothing in 
camel-servlet or camel-http-common reads HttpCommonEndpoint.isAsync(); 
CamelServlet.isAsync() only comes from the init parameter async of 
CamelHttpTransportServlet (camel-jetty passes the option on as that init 
parameter).
Proposed change: exclude the option for servlet, or pass it on.

h4. 3. httpMethodRestrict is a case-sensitive substring match
{{CamelServlet.doExecute}} checks httpMethodRestrict with String.contains, so 
the check is case-sensitive and matches substrings; camel-jetty splits the list 
and uses equalsIgnoreCase.
Proposed change: split on comma and compare each method, ignoring case.

h4. 4. Smaller issues
The component option httpConfiguration is never read by the servlet component. 
A custom component httpRegistry only gets the consumers: 
CamelHttpTransportServlet always registers in 
DefaultHttpRegistry.getHttpRegistry(servletName). bridgeEndpoint is labelled 
producer, but CamelServlet and CamelContinuationServlet also read it on the 
consumer. chunked has no label (it only matters for consumers).


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to