[
https://issues.apache.org/jira/browse/ROL-1703?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Glen Mazza closed ROL-1703.
---------------------------
Resolution: Won't Fix
We don't use SiteMesh, but AFAIK ordering of HTTP headers is not significant:
http://stackoverflow.com/questions/750330/does-the-order-of-headers-in-an-http-response-ever-matter
Offhand, it would appear that if is SiteMesh is requiring them to be in a
certain order, then the problem is with Sitemesh and a JIRA should be sent to
them. I can't however find any Sitemesh documentation stating that the
ordering of the headers must be a certain way or active mailing list to ask.
Now if it *were* significant--the premise of this JIRA--I'd be reluctant to
make this change anyway not knowing all the possible things changing the
ordering would break.
> PageServlet sets content length before content type, precluding use of
> SiteMesh
> -------------------------------------------------------------------------------
>
> Key: ROL-1703
> URL: https://issues.apache.org/jira/browse/ROL-1703
> Project: Roller
> Issue Type: Bug
> Affects Versions: 4.0
> Reporter: Nick Lothian
> Assignee: Roller Unassigned
>
> If content is cached within Roller, the content length will be set before the
> content type. If filters exist which decorate the page in anyway (eg,
> SiteMesh) then the content length will be wrong, causing rendering issues.
> Reordering setContentLength and setContentType fixes the issue, because
> SiteMesh can know that is is handling the request (it bases that on
> ContentType) and will then calculate ContentLength itself.
> Patch follows:
> Index:
> C:/eclipse/workspace/roller-4.0/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
> ===================================================================
> ---
> C:/eclipse/workspace/roller-4.0/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
> (revision 635762)
> +++
> C:/eclipse/workspace/roller-4.0/apps/weblogger/src/java/org/apache/roller/weblogger/ui/rendering/servlets/PageServlet.java
> (working copy)
> @@ -200,8 +200,8 @@
> this.processHit(weblog,
> request.getRequestURL().toString(), request.getHeader("referer"));
> }
>
> + response.setContentType(cachedContent.getContentType());
> response.setContentLength(cachedContent.getContent().length);
> - response.setContentType(cachedContent.getContentType());
> response.getOutputStream().write(cachedContent.getContent());
> return;
> } else {
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira