Skip to content

HTTP Adapter URI mappings are sensitive to trailing slashes [INT-3135] #7110

@spring-operator

Description

@spring-operator

Ronald D Kurr opened INT-3135 and commented

I have a working inbound HTTP gateway that uses the path "/resources/{firstName}" that works fine when the GET is issued from Chrome.
The same GET fails when issued from the REST Shell. I watched things in the debugger and it looks to me that the REST Shell adds a trailing slash to its request - /resources/bob/
which causes the HashMap lookup to fail because the path that is stored doesn't have a trailing slash.
My guess is that we need to lop off any trailing slashes prior to doing the look up.

This was done in the context of a Spring MVC application so UriPathHandlerMapping was in play. Here is the relevant XML bits:

<int-http:inbound-gateway id="inboundGateway"
mapped-request-headers="*"
mapped-response-headers="*"
path="/resources/{firstName}"
supported-methods="POST,GET"
request-channel="request-channel"
reply-channel="response-channel">
<int-http:header name="firstName" expression="#pathVariables.firstName"/>
</int-http:inbound-gateway>

<int:service-activator input-channel="request-channel" output-channel="response-channel" requires-reply="true">
<bean class="com.transparent.molde.adapter.inbound.rest.SimpleServiceActivator"/>
</int:service-activator>

<bean class="org.springframework.integration.http.inbound.UriPathHandlerMapping"/>


Affects: 2.2.5

Issue Links:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions