jonashaag/Nano — Issue #1: Incorrect URLs Generated
Author: jondb
Created: 2011-12-28 00:06:16+00:00
State: open

URLs generated at webserver root (domain.com/_klaus_path_).

I wanted support for URLs relative to root (domain.com/git/_klaus_path_).

# git diff nano.py
diff --git a/nano.py b/nano.py
index 5b9344b..83e1734 100644
--- a/nano.py
+++ b/nano.py
@@ -165,6 +165,7 @@ class NanoApplication(object):
if wildcards or not pattern.match(url) or \
re.search(named_group_re % '.+?', url):
raise ValueError("Wildcard substitutions didn't match pattern")
+ url = "%s%s" % (os.environ['SCRIPT_NAME'], url)
return url

def __call__(self, environ, start_response):

Grep http://www.python.org/dev/peps/pep-0333/ for SCRIPT_NAME
Also http://www.python.org/dev/peps/pep-0333/#id34 for URL Reconstruction.