Redirect to referer on Error #8

If `onError` is not set, the default referer will be used.
pull/21/head
Niclas Thobaben 2022-02-15 12:17:34 +01:00
parent daea4c04ca
commit a284b8f9c8
1 changed files with 2 additions and 1 deletions

View File

@ -29,7 +29,8 @@ public class MessageFormController {
BindingResult bindingResult) {
if(bindingResult.hasErrors()) {
return "redirect:" + form.getOnError();
String onError = (form.getOnError() != null ? form.getOnError() : referer);
return "redirect:" + onError;
}
String token = form.getToken();