I am working on Spring Boot upgrade to 3.2. In this upgrade when the spring health check happens it triggers the health check URL as https://localhost:8443/actuator. The check fails with the error There was an unexpected error (type=Internal Server Error, status=500). Cannot invoke "java.util.Enumeration.hasMoreElements()" because "ifNoneMatchHeaders" is null java.lang.NullPointerException: Cannot invoke "java.util.Enumeration.hasMoreElements()" because "ifNoneMatchHeaders" is null at org.springframework.web.context.request.ServletWebRequest.validateIfNoneMatch(ServletWebRequest.java:247) at org.springframework.web.context.request.ServletWebRequest.checkNotModified(ServletWebRequest.java:225) at org.springframework.web.context.request.ServletWebRequest.checkNotModified(ServletWebRequest.java:199)
Then we found that we have to sent if-non-matches along with the header. But how to add header param only for health check?