Package: bugs.debian.org
Severity: wishlist

Hi there Don,

following your talk @DebConf17, I just went ahead and wrote a quick patch (two,
actually) to replace browser-side redirects with Apache passthroughs.

I've only done a quick test without cgi-bin in the loop, but it seems to work
directly. It seems like it's merely a s/L,R/PT/ accross the Apache
configuration.

Cheers,
        OdyX
>From cf9d1519ac04a272f0e32062077154cc0ec4dab0 Mon Sep 17 00:00:00 2001
From: Didier Raboud <o...@debian.org>
Date: Thu, 10 Aug 2017 18:27:12 -0400
Subject: [PATCH 1/2] Use PT|passthrough redirects for ^/([0-9]+)$ for
 bugreport.cgi & ^/([^/]+)$ for pkgreport.cgi

---
 examples/apache.conf | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/examples/apache.conf b/examples/apache.conf
index 0c1315d..7ed13c6 100644
--- a/examples/apache.conf
+++ b/examples/apache.conf
@@ -43,6 +43,7 @@
     # RewriteMap fix-chars     int:noescape
     RewriteCond %{REQUEST_URI} 
^/(Access\.html|Developer\.html|Reporting\.html|server-request\.html|server-control\.html|server-refcard\.html).*
 [NC]
     RewriteRule .* - [L]
-    RewriteRule ^/([0-9]+)$ /cgi-bin/bugreport.cgi?bug=$1 [L,R,NE]
-    RewriteRule ^/([^/]+)$ /cgi-bin/pkgreport.cgi?pkg=$1 [L,R,NE]
+    # PT|passthrough to bugreport.cgi and pkgreport.cgi
+    RewriteRule ^/([0-9]+)$ /cgi-bin/bugreport.cgi?bug=$1 [PT,NE]
+    RewriteRule ^/([^/]+)$ /cgi-bin/pkgreport.cgi?pkg=$1 [PT,NE]
 </VirtualHost>
-- 
2.14.0

>From 1b98c0b8958b53d9fd1f32cdd771d6fe400499e8 Mon Sep 17 00:00:00 2001
From: Didier Raboud <o...@debian.org>
Date: Thu, 10 Aug 2017 18:30:12 -0400
Subject: [PATCH 2/2] Use PT|passthrough redirects also for all other rewrites

---
 examples/apache.conf | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/examples/apache.conf b/examples/apache.conf
index 7ed13c6..6232e03 100644
--- a/examples/apache.conf
+++ b/examples/apache.conf
@@ -32,14 +32,14 @@
     # The following two redirect to up-to-date pages
     RewriteRule ^/[[:space:]]*#?([[:digit:]][[:digit:]][[:digit:]]+)([;&].+)?$ 
/cgi-bin/bugreport.cgi?bug=$1$2 [L,R,NE]
     RewriteRule ^/([^/+]*)([+])([^/]*)$ "/$1%%{%}2B$3" [N]
-    RewriteRule ^/[Ff][Rr][Oo][Mm]:([^/]+\@.+)$ 
/cgi-bin/pkgreport.cgi?submitter=$1 [L,R,NE]
+    RewriteRule ^/[Ff][Rr][Oo][Mm]:([^/]+\@.+)$ 
/cgi-bin/pkgreport.cgi?submitter=$1 [PT,NE]
     # Commented out, 'cuz aj says it will crash master. (old master)
     # RewriteRule ^/[Ss][Ee][Vv][Ee][Rr][Ii][Tt][Yy]:([^/]+\@.+)$ 
/cgi-bin/pkgreport.cgi?severity=$1 [L,R]
-    RewriteRule ^/([^/]+\@.+)$ /cgi-bin/pkgreport.cgi?maint=$1 [L,R,NE]
-    RewriteRule ^/mbox:([[:digit:]][[:digit:]][[:digit:]]+)([;&].+)?$ 
/cgi-bin/bugreport.cgi?mbox=yes&bug=$1$2 [L,R,NE]
-    RewriteRule ^/src:([^/]+)$ /cgi-bin/pkgreport.cgi?src=$1 [L,R,NE]
-    RewriteRule ^/severity:([^/]+)$ /cgi-bin/pkgreport.cgi?severity=$1 [L,R,NE]
-    RewriteRule ^/tag:([^/]+)$ /cgi-bin/pkgreport.cgi?tag=$1 [L,R,NE]
+    RewriteRule ^/([^/]+\@.+)$ /cgi-bin/pkgreport.cgi?maint=$1 [PT,NE]
+    RewriteRule ^/mbox:([[:digit:]][[:digit:]][[:digit:]]+)([;&].+)?$ 
/cgi-bin/bugreport.cgi?mbox=yes&bug=$1$2 [PT,NE]
+    RewriteRule ^/src:([^/]+)$ /cgi-bin/pkgreport.cgi?src=$1 [PT,NE]
+    RewriteRule ^/severity:([^/]+)$ /cgi-bin/pkgreport.cgi?severity=$1 [PT,NE]
+    RewriteRule ^/tag:([^/]+)$ /cgi-bin/pkgreport.cgi?tag=$1 [PT,NE]
     # RewriteMap fix-chars     int:noescape
     RewriteCond %{REQUEST_URI} 
^/(Access\.html|Developer\.html|Reporting\.html|server-request\.html|server-control\.html|server-refcard\.html).*
 [NC]
     RewriteRule .* - [L]
-- 
2.14.0

Reply via email to