-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
Adding Null Check for validateIfNoneMatch() method #34511
Conversation
Null check to avoid N.P.Es Signed-off-by: Dineshotham Kumar Khambhammettu <[email protected]>
Please merge it so that this header is not mandatory |
The
Did you encounter a |
@bclozel
|
Thanks for the feedback @dk185173 . I believe the bug is somewhere else, but not in Spring. Maybe one of your custom filters is not wrapping the request properly and returns a I couldn't reproduce this behavior with a vanilla Spring application: @Controller
public class TestController {
@GetMapping("/")
@ResponseBody
public String test(ServletWebRequest request) {
if (request.checkNotModified("test")) {
return null;
}
return "test";
}
}
I'm closing this as a result. |
@bclozel We encountered this issue after we upgraded from Spring 5->Spring 6. It was working in Spring 5. |
I guess all of your application dependencies changed as well, since the Spring 5 -> Spring 6 upgrade requires a javax->jakarta change. From here, I think you can work on a minimal sample application, starting with the controller I've provided and add things bit by bit, starting witht the Servlet container you are using, then custom filters, etc. The bug is most probably on a Servlet request wrapper implementation. You can also use a debug break point and inspect the |
Basic Null Check to avoid Null pointer exception if the header is not sent