The Servlet API doesn't say that Content-Type has to be available in ServletResponse.getHeader() and Tomcat actually takes explicit steps to ensure it is not stored as a header (despite being sent as a header to the remote client). So a lot of busywork goes on in Spring if the content type has been set explicitly but is coming back from ServletResponseHttpHeaders as null. Undertow (in contrast) internally chooses to store the content type as a header, so the two servers behave differently and Undertow is faster if the content type is explicitly set.