Mercurial > p > roundup > code
comparison roundup/scripts/roundup_server.py @ 4913:8f6cfe824c9f
roundup_server: Fix endless redirect on http://localhost:8917/demo?anything
| author | anatoly techtonik <techtonik@gmail.com> |
|---|---|
| date | Thu, 17 Jul 2014 02:27:06 +0300 |
| parents | a0a7a6ca1586 |
| children | 96dc9f07340a |
comparison
equal
deleted
inserted
replaced
| 4912:a0a7a6ca1586 | 4913:8f6cfe824c9f |
|---|---|
| 334 # handle missing trailing '/' | 334 # handle missing trailing '/' |
| 335 if len(l_path) == 2: | 335 if len(l_path) == 2: |
| 336 self.send_response(301) | 336 self.send_response(301) |
| 337 # redirect - XXX https?? | 337 # redirect - XXX https?? |
| 338 protocol = 'http' | 338 protocol = 'http' |
| 339 url = '%s://%s%s/'%(protocol, self.headers['host'], self.path) | 339 url = '%s://%s%s/'%(protocol, self.headers['host'], rest) |
| 340 if query: | |
| 341 url += '?' + query | |
| 340 self.send_header('Location', url) | 342 self.send_header('Location', url) |
| 341 self.end_headers() | 343 self.end_headers() |
| 342 self.wfile.write('Moved Permanently') | 344 self.wfile.write('Moved Permanently') |
| 343 return | 345 return |
| 344 | 346 |
