Sun Java System Web Server 7.0 Update 7 Installation and Migration Guide

Content-type Header

After migration from 6.1, Web Server 7.0 will not return Content-type:text/html when there is no message body, for instance, a redirection location header. Since response doesn't contain the message body, there's no reason to specify a Content-Type header hence this is a conscious change made in 7.0 as compared to 6.1. For customers who still depend on Content-type can make the following configuration changes in 7.0.

To add back the content-type in output stage

Add the following content into Web Server 7.0 obj.conf


Service method="(GET|HEAD)" type="magnus-internal/directory" fn="index-common"
Service method="(GET|HEAD|POST)" type="*~magnus-internal/*" fn="send-file"
Service method="TRACE" fn="service-trace"
<If $uri =~ ".jsp$">
Output fn="set-variable" insert-srvhdrs="Content-type: text/html"
</If>
Error fn="error-j2ee"
AddLog fn="flex-log"
</Object>

When content-type is 302


<If  $code = "302" >
Output fn="set-variable" insert-srvhdrs="content-type:text/html"
</If>

When content-length is zero


<If $srvhdrs{'content-length'} = "0">
Output fn="set-variable" insert-srvhdrs="content-type:text/html"
</If>