I know, but it's quite an undocumented feature ....

I guess I spoke from my bad english, but actually I was proposing to modify 
stream_file_or_304_or_206 to check if headers set in the method are yet 
defined before overwriting them.

Sorry again and thanks again ^_^

Il giorno domenica 10 giugno 2012 15:59:57 UTC+2, Anthony ha scritto:
>
> If you pass the open file object to response.stream, it should not call 
> stream_file_or_304_or_206 -- it only calls that if you pass the file path 
> as a string to response.stream. When I tried it (with the code I posted), 
> it worked fine (i.e., the header was set as specified in the HTTP() call).
>
> Anthony
>
> On Sunday, June 10, 2012 9:20:13 AM UTC-4, Niphlod wrote:
>>
>> well, pinpointed in the right direction, but sadly it doesn't 
>> work.....after creating a dummy controller just to let the request be 
>> accepted, I think I found the culprit:
>>
>> raise HTTP(200, response.stream(file), headers)
>>
>> will stop execution, but raising actually from response.stream, that 
>> calls stream_file_or_304_or_206, so headers are set in that call, and not 
>> the one raised from the model itself.
>>
>> next step, check stream_file_or_304_or_206, *Cache-Control : private* is 
>> set as fixed, so overriding it in response.stream call or even calling 
>> directly stream_file_or_304_or_206 won't work.
>> Adding an Expires header won't work nonetheless, because for HTTP specs 
>> Cache-Control "wins" over Expires header ...... 
>>
>> The only way is to use streamer directly, but all other headers, 
>> content-type detection, etc would need to be rewritten
>>
>

Reply via email to