- 
                Notifications
    You must be signed in to change notification settings 
- Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply
Description
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:
- Response is committed before Interceptor postHandle invoked [SPR-9226] #13864 Response is committed before Interceptor postHandle invoked ("duplicates")
- Make HandlerInterceptor play nice with @ResponseBody [SPR-7897] #12553 Make HandlerInterceptor play nice with @ResponseBody
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)status: declinedA suggestion or change that we don't feel we should currently applyA suggestion or change that we don't feel we should currently apply