summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--paste/urlparser.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/paste/urlparser.py b/paste/urlparser.py
index 0e6efac..47e89aa 100644
--- a/paste/urlparser.py
+++ b/paste/urlparser.py
@@ -239,10 +239,16 @@ class URLParser(object):
# % (base_filename, self.directory))
return None
if len(possible) > 1:
- environ['wsgi.errors'].write(
- 'Ambiguous URL: %s; matches files %s\n'
- % (wsgilib.construct_url(environ),
- ', '.join(possible)))
+ # If there is an exact match, this isn't 'ambiguous'
+ # per se; it might mean foo.gif and foo.gif.back for
+ # instance
+ if full_filename in possible:
+ return full_filename
+ else:
+ environ['wsgi.errors'].write(
+ 'Ambiguous URL: %s; matches files %s\n'
+ % (wsgilib.construct_url(environ),
+ ', '.join(possible)))
return None
return possible[0]