On Mon, Aug 02, 2004 at 11:55:56AM -0700, Stas Bekman wrote: [...] > Actually I the problem I saw was exactly what Boris was talking about: > The C-L header wasn't there. The test simply exercises 4 different > combinations of sending and not sending C-L header and content. > > >my point was that as long as apache does whatever it does > >consistently between GET and HEAD it's not a bug. but maybe I'm just not > >seeing it, so if you guys grok all of that and still see an issue, let's > >flesh it out. > > I think it's there. The test that shows that is: > > { > # if the response handler sends no data, and sets C-L header, > # the client doesn't get C-L header > my $uri = "$location?set_content_length"; > my $res = $method->($uri); > ok t_cmp $res->code, 200, "$method $uri code"; > ok t_cmp $res->header('Content-Length'), undef, "$method $uri > C-L header"; > ok t_cmp $res->content, "", "$method $uri content"; > } > > As I didn't know what's the right thing that should happen, I didn't > make it a failure. But it probabaly shouldn't be undef in the C-L check. > > But the fact that sending a bogus char and a different C-L header works > with HEAD (gets the C-L header through), whereas not sending any output > breaks, seems like a bug to me. As mentioned earlier I think the bug is > in the headers_out filter, which received EOS (since on HEAD apache > scratches the response body) and no body. So it takes the liberty to > nuke the C-L header, which I'm not sure is a good thing. When we send > some body, headers_out sends the headers before seeing EOS and therefore > it can't tell whether the body is coming or not, so it leaves the C-L > header alone. Which is at least inconsistent.
I mentioned to Geoff off-list about possibly using a flush bucket, since I don't have a test setup ready (just replaced my dead laptop hard drive) I wrote: > > I used to make good use of $r->send_http_header() in my MP1 handlers. > > This method isn't available in MP2 (why?), though I could picture it > > replaced by sending a flush bucket down the filter chain. > On Tue, Aug 03, 2004 at 10:04:38AM -0400, Geoffrey Young wrote: > apache now sends the headers for you via the header filter. if you were > allowed to send your own headers you might send them before a filter ran > that would alter the headers. for instance, mod_include removes the ETag > header. Would a flush bucket be a great way to say "send headers now"? So if you're not going to send the actual content down the filter chain on a HEAD request, would sending a flush bucket make things happy? IIF this works, can I make a request the $r->send_http_header() be implemented in Apache2 to do just that? (create and pass a flush bucket) Cheers, Glenn -- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html