diff options
author | James Taylor <user234683@users.noreply.github.com> | 2019-09-07 21:40:38 -0700 |
---|---|---|
committer | James Taylor <user234683@users.noreply.github.com> | 2019-09-07 21:40:38 -0700 |
commit | 6a55771630cd96b91881dddcb62bc54b01a7b2a8 (patch) | |
tree | 8f0bbebdc02b5ccbfbd564a0027dff5ca139590b | |
parent | d356e40f1ca8923babe4d3f490310cf86a8008e0 (diff) | |
download | yt-local-6a55771630cd96b91881dddcb62bc54b01a7b2a8.tar.lz yt-local-6a55771630cd96b91881dddcb62bc54b01a7b2a8.tar.xz yt-local-6a55771630cd96b91881dddcb62bc54b01a7b2a8.zip |
Redirect localhost:8080 to homepage
-rw-r--r-- | server.py | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -81,6 +81,11 @@ def site_dispatch(env, start_response): yield error_code('403 Forbidden', start_response) return + # redirect localhost:8080 to localhost:8080/https://youtube.com + if path == '' or path == '/': + start_response('302 Found', [('Location', '/https://youtube.com')]) + return + try: env['SERVER_NAME'], env['PATH_INFO'] = split_url(path[1:]) except ValueError: |