1
0
Fork 0
forked from github/pelican

Merge pull request #2022 from rjames86/query_strings

Prevent server from dying when query strings present
This commit is contained in:
Justin Mayer 2016-12-12 10:18:04 -08:00 committed by GitHub
commit 3518713ac6

View file

@ -18,6 +18,10 @@ class ComplexHTTPRequestHandler(srvmod.SimpleHTTPRequestHandler):
SUFFIXES = ['', '.html', '/index.html']
def do_GET(self):
# cut off a query string
if '?' in self.path:
self.path, _ = self.path.split('?', 1)
# Try to detect file by applying various suffixes
for suffix in self.SUFFIXES:
if not hasattr(self, 'original_path'):