Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added redirect.

  • Loading branch information...
commit 0d67f9bd6702456d8eae7db7c29236ce74c244a2 1 parent 747ccc0
@davisp authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 futonproxy.py
View
11 futonproxy.py
@@ -37,6 +37,17 @@ def __init__(self, couch, dname):
self.dname = dname
def __call__(self, environ, start_response):
+ if environ['PATH_INFO'] == '/_utils':
+ url = ''.join([
+ environ['wsgi.url_scheme'],
+ '://',
+ environ.get('HTTP_HOST', environ['SERVER_NAME']),
+ '/_utils/'
+ ])
+ start_response('301 MOVED PERMANENTLY', [
+ ('Location', url)
+ ])
+ return ['Its not here!\n']
if environ['PATH_INFO'].startswith("/_utils"):
return self.send_file(environ, start_response)
return self.proxy_request(environ, start_response)
Please sign in to comment.
Something went wrong with that request. Please try again.