[ljcom] r3613: alt img/stat prefix code.

Oct 06, 2006 22:53


Committer: bradfitzalt img/stat prefix code.

U trunk/cgi-bin/ljcom.pl

Modified: trunk/cgi-bin/ljcom.pl
===================================================================
--- trunk/cgi-bin/ljcom.pl 2006-10-06 22:07:40 UTC (rev 3612)
+++ trunk/cgi-bin/ljcom.pl 2006-10-06 22:53:26 UTC (rev 3613)
@@ -3535,4 +3535,13 @@
return ();
});

+LJ::register_hook('set_alternate_statimg', sub {
+ my $r = eval { Apache->request } or return 0;
+ my $ip = $r->connection->remote_ip;
+ # TODO: per-first-two-octet lookup, to then find rules and find right prefixes
+ return 0 unless $LJ::ALT_STAT_HOOK;
+ return $LJ::ALT_STAT_HOOK->($ip);
+});
+
+
1;

Previous post Next post
Up