Ticket #1517: bug-redirect.patch
| File bug-redirect.patch, 1.2 KB (added by dreid, 7 years ago) |
|---|
-
twisted-web/twisted-web
10 10 from twisted.internet import app 11 11 from twisted.python import filepath 12 12 13 class BugsRedirect(twutil.Redirect): 14 def __init__(self): 15 twutil.Redirect.__init__(self, '/trac/report') 16 17 def getChild(self, name, request): 18 if name.startswith('issue'): 19 return twutil.Redirect('/trac/ticket/%s' % (name[5:],)) 20 21 return twutil.Redirect.getChild(self, name, request) 22 13 23 # Add useful extra extension -> content-type mapping entries 14 24 static.File.contentTypes['.tac'] = 'text/plain' 15 25 … … 59 69 # These are only on (www.)twistedmatrix.com 60 70 tm.putChild('buildbot', distrib.ResourceSubscription('unix', '/home/buildbot/.twistd-web-pb')) 61 71 #tm.putChild('bugs', proxy.ReverseProxyResource('twistedmatrix.com', 8085, '/twisted')) 62 tm.putChild('bugs', twutil.Redirect('/trac/report'))72 tm.putChild('bugs', BugRedirect()) 63 73 tm.putChild('trac', proxy.ReverseProxyResource('twistedmatrix.com', 9881, '/trac')) 64 74 65 75 tm.putChild('twisted', twutil.ChildRedirector('http://twistedmatrix.com/bugs/'))
