cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Unico Hommes <un...@hippo.nl>
Subject Re: svn commit: rev 55002 - cocoon/trunk/src/java/org/apache/cocoon/environment/wrapper
Date Mon, 18 Oct 2004 15:06:28 GMT
Sylvain Wallez wrote:

> Unico Hommes wrote:
>
>> Sylvain Wallez wrote:
>>
>>> unico@apache.org 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?
>
>
>
> Mmmh... you're right :-)
>
> I guess we should make the distinction between wrappers for internal 
> redirects, that would not wrap the response, and wrappers for cocoon: 
> sources that must wrap the response. A simple additional boolean in 
> the EnvironmentWrapper constructor should to the trick.
>

Yeah, that should do the trick. I'll take care of it. Thanks for 
catching this :-)

--
Unico


Mime
View raw message