[
https://issues.apache.org/jira/browse/CAMEL-11951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16226553#comment-16226553
]
Claus Ibsen commented on CAMEL-11951:
-------------------------------------
Got it fixed
Sending these requests
{code}
davsclaus:/Users/davsclaus/Downloads/camel-bug-demo/$ curl
http://localhost:8078/integration/api/v1/customer/999999/detail
davsclaus:/Users/davsclaus/Downloads/camel-bug-demo/$ curl
http://localhost:8078/integration/api/v1/customer/123456/devices
davsclaus:/Users/davsclaus/Downloads/camel-bug-demo/$ curl
http://localhost:8078/integration/api/v1/customer/123456/detail
davsclaus:/Users/davsclaus/Downloads/camel-bug-demo/$ curl -XPUT
http://localhost:8078/integration/api/v1/customer/123456/detail
{code}
And it logs now
{code}
[INFO ] 2017-10-31 11:08:09.257 [qtp810576909-21] proxyOutbound:159 - Proxied
call GET - /customer/999999/detail
[INFO ] 2017-10-31 11:08:17.556 [qtp810576909-16] getCustomerDevices:159 -
getCustomer devices 123456
[INFO ] 2017-10-31 11:08:24.964 [qtp810576909-18] proxyOutbound:159 - Proxied
call GET - /customer/123456/detail
[INFO ] 2017-10-31 11:08:44.232 [qtp810576909-18] proxyOutbound:159 - Proxied
call PUT - /customer/123456/detail
{code}
> Uri matching does not match request type
> ----------------------------------------
>
> Key: CAMEL-11951
> URL: https://issues.apache.org/jira/browse/CAMEL-11951
> Project: Camel
> Issue Type: Bug
> Components: camel-http-common
> Affects Versions: 2.20.0
> Environment: camel-spring, camel-jetty
> OS - RHEL
> Reporter: Robert Hillier
> Assignee: Claus Ibsen
> Fix For: 2.20.1, 2.21.0
>
> Attachments: camel-bug-demo.zip
>
>
> I had previously described the problem here:
> https://stackoverflow.com/questions/46936348/apache-camel-rest-dsl-405-method-not-allowed
> It appears that the problem is down to a possible bug in the way URIs are
> matched (not to mention my rather obscure use-case)
> I have a number of REST-DSL endpoints with the same URI but different request
> types (POST, PUT, GET, DELETE). In my case, the URI is getting selected by
> HttpServletResolveConsumerStrategy.resolve (in addition to these, I have some
> specific endpoints with wildcards in them)
> This method matches the URI, but not the request type. When I send a GET
> request, it returns the first consumer candidate it finds which, in my case,
> always seems to be PUT. Later, when CamelContinuationServlet.doService
> checks that the request type and cadidate type match, they don't. It then
> returns 405 Method Not Allowed.
> I believe that the HttpServletResolveConsumerStrategy.resolve method IN
> camel-hhtp-common should check the request type as well as the URI.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)