mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
3b4a3431d4
Prior to this commit, calls to setHeader() and addHeader() in MockHttpServletResponse would result in an IllegalArgumentException or NullPointerException if the supplied header value was null. Although the Javadoc for setHeader(String, String) and addHeader(String, String) in javax.servlet.http.HttpServletResponse does not specify how a null header value should be handled, both Tomcat and Jetty simply ignore a null value. Furthermore, org.springframework.http.HttpHeaders.add(String, String) declares the headerValue parameter as @Nullable. This commit therefore updates MockHttpServletResponse to silently ignore null header values passed to setHeader() and addHeader(). Closes gh-26488