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

[PATCH] gitweb: Fix snapshots requested via PATH_INFO

From
Holger Weiß <holger@zedat.fu-berlin.de>
Date
Mar 31, 2009, 16:16 UTC
Message-ID
<20090331161636.GV30233737@CIS.FU-Berlin.DE>

Fix the detection of the requested snapshot format, which failed for PATH_INFO URLs since the references to the hashes which describe the supported snapshot formats weren't dereferenced appropriately.

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
---
 gitweb/gitweb.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 33ef190..3f99361 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -688,10 +688,10 @@ sub evaluate_path_info {
 		# extensions. Allowed extensions are both the defined suffix
 		# (which includes the initial dot already) and the snapshot
 		# format key itself, with a prepended dot
-		while (my ($fmt, %opt) = each %known_snapshot_formats) {
+		while (my ($fmt, $opt) = each %known_snapshot_formats) {
 			my $hash = $refname;
 			my $sfx;
-			$hash =~ s/(\Q$opt{'suffix'}\E|\Q.$fmt\E)$//;
+			$hash =~ s/(\Q$opt->{'suffix'}\E|\Q.$fmt\E)$//;
 			next unless $sfx = $1;
 			# a valid suffix was found, so set the snapshot format
 			# and reset the hash parameter
-- 
1.6.2.1
Message 1 of 1 in “gitweb: Fix snapshots requested via PATH_INFO”
  1. gitweb: Fix snapshots requested via PATH_INFOHolger Weiß, Mar 31, 2009

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.