mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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']
|
SUFFIXES = ['', '.html', '/index.html']
|
||||||
|
|
||||||
def do_GET(self):
|
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
|
# Try to detect file by applying various suffixes
|
||||||
for suffix in self.SUFFIXES:
|
for suffix in self.SUFFIXES:
|
||||||
if not hasattr(self, 'original_path'):
|
if not hasattr(self, 'original_path'):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue