StringHttpMessageConverter flush out response immediately before execute posthandler [SPR-16046] #20595
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
status: declined
A suggestion or change that we don't feel we should currently apply
Uh oh!
There was an error while loading. Please reload this page.
eric wang opened SPR-16046 and commented
the problem is related
@RequestBody
the ajax request, if the response content-type is text/plain that means the handler method return string directly, the StringHttpMessageConverter will getting used to handler the HTTP message convert. the problem seems in the writeInternal method, it is calling StreamUtils.copy(String in, Charset charset, OutputStream out) which will create a new Write and flush the response content out immediately.this problem caused all subsequence handlers like posthandler got executed after response return to the client.
the repro steps should be easy, just create a controller with
@ResponseBody
and return string directly.Affects: 4.3.11
Issue Links:
@ResponseBody
The text was updated successfully, but these errors were encountered: