summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2011-03-08 10:06:50 +0000
committerMagnus Hagander2011-03-08 10:10:59 +0000
commit5d3b332450cccb3ef51382017b6916b99d346395 (patch)
treeb3fad905330c493515bdb6ec90acd0a210c882ec
parenta8b81f740b1e052912712e9474b9cc7d732cb730 (diff)
Update FastCGI integration points to work properly with lighttpd.
-rw-r--r--perl-lib/PgCommitFest/Handler.pm3
-rw-r--r--perl-lib/PgCommitFest/Request.pm7
2 files changed, 7 insertions, 3 deletions
diff --git a/perl-lib/PgCommitFest/Handler.pm b/perl-lib/PgCommitFest/Handler.pm
index 438f7e0..edc838c 100644
--- a/perl-lib/PgCommitFest/Handler.pm
+++ b/perl-lib/PgCommitFest/Handler.pm
@@ -61,7 +61,8 @@ sub main_loop {
sub handler {
my ($r) = @_;
my ($action, $extrapath);
- my $url = $ENV{'SCRIPT_URL'};
+ my $url = $ENV{'REQUEST_URI'};
+ $url =~ s/\?.*//; # Remove questionmark and anything after it
if ($url eq '/') {
$action = 'commitfest_search';
}
diff --git a/perl-lib/PgCommitFest/Request.pm b/perl-lib/PgCommitFest/Request.pm
index 9710c5d..ada9de5 100644
--- a/perl-lib/PgCommitFest/Request.pm
+++ b/perl-lib/PgCommitFest/Request.pm
@@ -199,8 +199,11 @@ sub render_template {
my %stash;
my $content = $self->generate_headers();
my $uri = '';
+ my $scriptname = $ENV{'REQUEST_URI'};
+ $scriptname =~ s/\?.*//;
+
if ($ENV{'REQUEST_METHOD'} eq 'GET') {
- if ($ENV{'SCRIPT_NAME'} ne '/action/login') {
+ if ($scriptname ne '/action/login') {
my $req = $ENV{'REQUEST_URI'};
$req =~ s/[^A-Za-z0-9]/sprintf "%%%x", ord($&)/ge;;
$uri = '?uri=' . $req;
@@ -218,7 +221,7 @@ sub render_template {
'rss_alternate' => $self->{'rss_alternate'},
'title' => $self->{'title'},
'error_list' => $self->{'error_list'},
- 'script_name' => $ENV{'SCRIPT_NAME'},
+ 'script_name' => $scriptname,
'uri' => $uri,
}, \$content) || die $template->error();
$template->process($file . '.tt2', \%stash, \$content)