summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hellkamp <marc@gsites.de>2011-06-27 11:55:40 +0200
committerMarcel Hellkamp <marc@gsites.de>2011-06-27 11:55:40 +0200
commitb2572600e0006304a080a0895e6f9e9d3523f418 (patch)
tree40249b9ab6f1192ed6bfb19eabb2374fa03311b6
parent87a39d602f9cd2ceb3d7f00d98b3fa04f0a96de3 (diff)
downloadbottle-b2572600e0006304a080a0895e6f9e9d3523f418.tar.gz
fix: Added a workaround for missing PATH_INFO in CGI environments. This fixes #177
Thanks to Michael Soulier
-rwxr-xr-xbottle.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bottle.py b/bottle.py
index 70a9a39..f44a69b 100755
--- a/bottle.py
+++ b/bottle.py
@@ -1852,7 +1852,10 @@ class CGIServer(ServerAdapter):
quiet = True
def run(self, handler): # pragma: no cover
from wsgiref.handlers import CGIHandler
- CGIHandler().run(handler) # Just ignore host and port here
+ def fixed_environ(environ, start_response):
+ environ.setdefault('PATH_INFO', '')
+ return handler(environ, start_response)
+ CGIHandler().run(fixed_environ)
class FlupFCGIServer(ServerAdapter):