Skip to content
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

RestTemplateXhrTransport fails for a StreamingHttpOutputMessage type request #23030

Closed
jkranes opened this issue May 24, 2019 · 0 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@jkranes
Copy link

jkranes commented May 24, 2019

The org.springframework.web.socket.sockjs.client.RestTemplateXhrTransport.XhrRequestCallback relies on the request.getBody() method, which is not supported if the request is an instance of StreamingHttpOutputMessage. The result is that the request will fail in this case.

The request may be a StreamingHttpOutputMessage if the underlying request factory is configured as a streaming request in order to use chunked encoding.

To fix the issue the code should check whether the request is an instance of StreamingHttpOutputMessage and in this case use the StreamingHttpOutputMessage.setBody() method to write to the request body.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label May 24, 2019
@rstoyanchev rstoyanchev self-assigned this May 28, 2019
@rstoyanchev rstoyanchev added this to the 5.2 M3 milestone May 28, 2019
@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels May 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants