Sylvain Wallez wrote:

[EMAIL PROTECTED] wrote:

Author: unico
Date: Mon Oct 18 06:10:24 2004
New Revision: 55002

Added:
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/ResponseWrapper.java


Modified:
cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper/EnvironmentWrapper.java


Log:
introduce WrappedResponse for preventing internal requests to modify the response headers
as discussed here: http://marc.theaimsgroup.com/?t=109783260100005&r=1&w=2



I haven't followed that discussion, but I think these changes will break internal redirects for external requests, as it won't allow to set headers in that case.


Example :
<map:match pattern="*/">
 <map:redirect-to uri="cocoon:/index.html"/>
</map:match>

The headers set by the called pipeline will be ignored although they should not. A check that the wrapped environment is external and avoid wrapping in that case should be enough, I guess.


I see, the TreeProcessor wraps the environment in a ForwardEnvironmentWrapper in the case of cocoon redirects. Hmm, but would the check on whether the wrapped environment is an external one really make the correct distinction though? Wouldn't that check also match the scenario that started this:


<map:match pattern="transformation">
 <map:read src="xsl"/>
</map:match>

<map:match pattern="page">
 <map:generate src="xml"/>
 <map:transform src="cocoon:/transformation"/>
 <map:serialize/>
</map:match>

Isn't the environment in which the "transformation" pipeline is processed also an environment wrapping an external one?

--
Unico

Reply via email to