git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v7 3/3] gitweb: add If-Modified-Since handling to git_snapshot().

From
W. Trevor King <wking@drexel.edu>
Date
Mar 28, 2012, 18:37 UTC
Message-ID
<20120328183712.GA5992@odin.tremily.us>
In-Reply-To
<201203282011.32148.jnareb@gmail.com>
On Wed, Mar 28, 2012 at 07:11:31PM +0100, Jakub Narebski wrote:
Show 15 quoted lines
> W. Trevor King wrote:
> >  	print $cgi->header(
> >  		-type => $known_snapshot_formats{$format}{'type'},
> >  		-content_disposition => 'inline; filename="' . $filename . '"',
> > +		-last_modified => (%co ? $latest_date{'rfc2822'} : ()),
> >  		-status => '200 OK');
> 
> I'm sorry to be bearer of bad news, but this is still incorrect.
> It should be:
> 
>    	print $cgi->header(
>    		-type => $known_snapshot_formats{$format}{'type'},
>    		-content_disposition => 'inline; filename="' . $filename . '"',
>   +		%co ? (-last_modified => $latest_date{'rfc2822'}) : (),
>    		-status => '200 OK');

Grr. Thanks. I'm getting lots of rebase practice on this patch set, but I'm still missing things…

Show 8 quoted lines
> And it was not caught by test because CGI.pm can output the last modified
> header as "Last-modified" (RFC 2616, sec 4.2 states "Field names are
> case-insensitive"), so the last check should be
> 
>   +	! grep -i "Last-Modified" gitweb.output
> 
> Hmmm... why we use gitweb.output and not gitweb.headers?  Is it consistency
> with earlier tests?

Yes, but I can switch to `gitweb.headers` if you'd like. Should I adjust all the header tests in t9501 to use `gitweb.headers` and `grep -i`? It should probably be a separate patch for the tests that existed before my i-m-s additions.

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy
Previous: Jakub NarebskiNext: Junio C Hamano
Message 6 of 18 in “gitweb: refactor If-Modified-Since handling”
  1. 0/3 gitweb: refactor If-Modified-Since handlingW. Trevor King, Mar 28, 2012
  2. 1/3 gitweb: add `status` headers to git_feed() responses.W. Trevor King, Mar 28, 2012
  3. 2/3 gitweb: refactor If-Modified-Since handlingW. Trevor King, Mar 28, 2012
  4. 3/3 gitweb: add If-Modified-Since handling to git_snapshot().W. Trevor King, Mar 28, 2012
  5. Jakub NarebskiMar 28, 2012
  6. W. Trevor KingMar 28, 2012
  7. Junio C HamanoMar 28, 2012
  8. W. Trevor KingMar 28, 2012
  9. Jakub NarebskiMar 28, 2012
  10. Jakub NarebskiMar 28, 2012
  11. 0/3 gitweb: refactor If-Modified-Since handlingW. Trevor King, Mar 29, 2012
  12. Junio C HamanoMar 30, 2012
  13. 1/3 gitweb: add `status` headers to git_feed() responses.W. Trevor King, Mar 29, 2012
  14. Jakub NarebskiMar 30, 2012
  15. 2/3 gitweb: refactor If-Modified-Since handlingW. Trevor King, Mar 29, 2012
  16. Jakub NarebskiMar 30, 2012
  17. 3/3 gitweb: add If-Modified-Since handling to git_snapshot().W. Trevor King, Mar 29, 2012
  18. Jakub NarebskiMar 30, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.