-
Notifications
You must be signed in to change notification settings - Fork 1.1k
INT-2455: HTTP outbound 'encode-uri' flag support #755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -348,7 +362,9 @@ protected Object handleRequestMessage(Message<?> requestMessage) { | |||
Class<?> expectedResponseType = this.determineExpectedResponseType(requestMessage); | |||
|
|||
HttpEntity<?> httpRequest = this.generateHttpRequest(requestMessage, httpMethod); | |||
ResponseEntity<?> httpResponse = this.restTemplate.exchange(uri, httpMethod, httpRequest, expectedResponseType, uriVariables); | |||
UriComponents uriComponents = UriComponentsBuilder.fromHttpUrl(uri).buildAndExpand(uriVariables); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Artem, I believe you need to continue to use fromUriString()
as is currently used by the RestTemplate
. The problem with using fromHttpUrl
is that if there's a fragment component (e.g http://......xyz?foo#bar), and encode-url="true"
the # will incorrectly be encoded...
junit.framework.ComparisonFailure: null expected:<...xx/si.test.queue?foo[#]bar> but was:<...xx/si.test.queue?foo[%23]bar>
at junit.framework.Assert.assertEquals(Assert.java:81)
Exactly, Gary! |
Hmmm - we have some inconsistency here with I wonder if we should take this opportunity to make them consistent - or at least, perhaps, provide aliases for |
IMO we may leave it as is. See |
BTW, if it's OK I'll add a note to the Reference Manual |
Yes, I think it's ok |
Now `<http:outbound-channel-adapter>` and `<http:outbound-gateway>` provide `encode-uri="false"` option do not encode request uri. It can be useful in some scenarios with non standard URL, e.g. RabbitMQ REST API: 'http://foo.RabbitMQ.com/api/queues/%2f/bar.queue' https://jira.springsource.org/browse/INT-2455
Pushed Reference Manual commit. |
LGTM; merging |
* INT-2455: INT-2455: Support HTTP Outbound 'encode-uri' Flag
Now
<http:outbound-channel-adapter>
and<http:outbound-gateway>
provideencode-uri="false"
option do not encode request uri.It can be useful in some scenarios with non standard URL, e.g. RabbitMQ REST API:
'http://foo.RabbitMQ.com/api/queues/%2f/bar.queue'
https://jira.springsource.org/browse/INT-2455