I have the following code
@RestController
public class TokenRefreshController {
@Autowired
TokenAuthenticationService tokenAuthenticationService;
@ApiOperation(value = "Generate new authentication token using a refresh token")
@RequestMapping(value = "/token/refresh",
method = RequestMethod.POST)
public void refreshToken(@RequestParam("refresh") String refreshToken, HttpServletResponse response) throws IOException {
System.out.println("WHEN REFRESHING TOKEN THE RESPONSE IS COMMITTED :" + response.isCommitted());
tokenAuthenticationService.refreshAuthToken(refreshToken,response);
}
}
On the line where i am printing to console it is always true. So the response is already committed before even entering my Controller. How can I get a response that is not committed, because I am setting some headers and returning errors when needed in the refreshAuthToken method.
As it was mentioned in the comments below one of the filters might be committing the response, but i still have no idea how to stop the filter from doing that.