]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1342784 - Serve robots.txt under plack mode
authorDylan William Hardison <dylan@hardison.net>
Sun, 26 Feb 2017 18:02:21 +0000 (18:02 +0000)
committerDylan William Hardison <dylan@hardison.net>
Sun, 6 Aug 2017 16:20:12 +0000 (12:20 -0400)
app.psgi

index 5a83a41e4d42d8edfd11486a8a0736908b68d410..b05e62bdc63151acc69453d1fc3e8be895d4beb6 100644 (file)
--- a/app.psgi
+++ b/app.psgi
@@ -38,21 +38,22 @@ use Plack::App::WrapCGI;
 use Plack::Response;
 
 use constant STATIC => qw(
-    data/assets
-    data/webdot
-    docs
-    extensions/[^/]+/web
-    graphs
-    images
-    js
-    skins
+    data/assets/
+    data/webdot/
+    docs/
+    extensions/[^/]+/web/
+    graphs/
+    images/
+    js/
+    skins/
+    robots\.txt
 );
 
 my $app = builder {
     my $static_paths
         = join( '|', sort { length $b <=> length $a || $a cmp $b } STATIC );
     enable 'Static',
-        path => qr{^/($static_paths)/},
+        path => qr{^/(?:$static_paths)},
         root => Bugzilla::Constants::bz_locations->{cgi_path};
 
     my $shutdown_app
@@ -96,6 +97,7 @@ my $app = builder {
         my $app = shift;
         return sub {
             my $env = shift;
+            warn "$env->{PATH_INFO} / $env->{SCRIPT_NAME}\n";
             $env->{PATH_INFO} = '/index.cgi' if $env->{PATH_INFO} eq '/';
             return $app->($env);
         };