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
Jakub Narebski <jnareb@gmail.com>
Date
Mar 28, 2012, 21:28 UTC
Message-ID
<201203282328.08876.jnareb@gmail.com>
In-Reply-To
<20120328183712.GA5992@odin.tremily.us>
On Wed, 28 Mar 2012, W. Trevor King wrote:
> On Wed, Mar 28, 2012 at 07:11:31PM +0100, Jakub Narebski wrote:
[...]
Show 13 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.

Eh, don't worry about this. First, I think we can assume that HTTP headers from CGI.pm will all start with capital letter.

Second, for positive match being overly strict is safe - if assumption doesn't hold we would get false failure. The problem is for negative match - being overly strict means that we won't catch the breakage.

I think that the gitweb.output vs gitweb.headers (and gitweb.body) is because those tests predate gitweb_run producing gitweb.headers file. Be consistent if you want, or use new feature in new test; you don't need to modernize t9501.

-- 
Jakub Narebski
Poland
Previous: Jakub NarebskiNext: W. Trevor King
Message 10 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.