Skip to content

Commit 90636ac

Browse files
committed
roundup_server: Code untangle - init rest variable when necessary
1 parent d251332 commit 90636ac

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

roundup/scripts/roundup_server.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ def index(self):
277277
def inner_run_cgi(self):
278278
''' This is the inner part of the CGI handling
279279
'''
280-
rest = self.path
281280

282-
if rest == '/favicon.ico':
281+
# self.path is /some/path?with&all=stuff
282+
if self.path == '/favicon.ico':
283283
# file-like object for the favicon.ico file information
284284
favicon_fileobj = None
285285

@@ -314,10 +314,12 @@ def inner_run_cgi(self):
314314

315315
return
316316

317-
i = rest.rfind('?')
317+
i = self.path.rfind('?')
318318
if i >= 0:
319-
rest, query = rest[:i], rest[i+1:]
319+
# rest starts with /, query is without ?
320+
rest, query = self.path[:i], self.path[i+1:]
320321
else:
322+
rest = self.path
321323
query = ''
322324

323325
# no tracker - spit out the index

0 commit comments

Comments
 (0)