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:
commit
3518713ac6
1 changed files with 4 additions and 0 deletions
|
|
@ -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'):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue