How should HttpServletResponse.setHeader method do with null value as below:
response.setHeader("ETag", null);
While implementing Servlet interface, I am a little bit confused on this because the Java Servlet Specification looks not clear about this.
I think I can choose one of these:
- Consider null as emptry string "". Set ETag header's value to "".
- Do nothing.
- Throw an exception.
In practice, Tomcat's implementation just ignore. And netty, even if it is not a Servlet implmentation, throws NullPointerException.