mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 11:32:20 -05:00
Fixed issue with facicon.ico file and static link being incorrect causing 404 errors.
This commit is contained in:
parent
067438b5d9
commit
18a1681a61
@ -13,6 +13,7 @@ from tornado.ioloop import IOLoop
|
||||
|
||||
server = None
|
||||
|
||||
|
||||
class MultiStaticFileHandler(StaticFileHandler):
|
||||
def initialize(self, paths, default_filename=None):
|
||||
self.paths = paths
|
||||
@ -33,6 +34,7 @@ class MultiStaticFileHandler(StaticFileHandler):
|
||||
# Oops file not found anywhere!
|
||||
raise HTTPError(404)
|
||||
|
||||
|
||||
def initWebServer(options={}):
|
||||
options.setdefault('port', 8081)
|
||||
options.setdefault('host', '0.0.0.0')
|
||||
@ -115,13 +117,15 @@ def initWebServer(options={}):
|
||||
|
||||
# Static Path Handler
|
||||
app.add_handlers(".*$", [
|
||||
('%s/%s/(.*)([^/]*)' % (options['web_root'], 'images'), MultiStaticFileHandler,
|
||||
(r'/(favicon\.ico)', MultiStaticFileHandler,
|
||||
{'paths': '%s/%s' % (options['web_root'], 'images/ico/favicon.ico')}),
|
||||
(r'%s/%s/(.*)(/?)' % (options['web_root'], 'images'), MultiStaticFileHandler,
|
||||
{'paths': [os.path.join(options['data_root'], 'images'),
|
||||
os.path.join(sickbeard.CACHE_DIR, 'images'),
|
||||
os.path.join(sickbeard.CACHE_DIR, 'images', 'thumbnails')]}),
|
||||
('%s/%s/(.*)([^/]*)' % (options['web_root'], 'css'), MultiStaticFileHandler,
|
||||
(r'%s/%s/(.*)(/?)' % (options['web_root'], 'css'), MultiStaticFileHandler,
|
||||
{'paths': [os.path.join(options['data_root'], 'css')]}),
|
||||
('%s/%s/(.*)([^/]*)' % (options['web_root'], 'js'), MultiStaticFileHandler,
|
||||
(r'%s/%s/(.*)(/?)' % (options['web_root'], 'js'), MultiStaticFileHandler,
|
||||
{'paths': [os.path.join(options['data_root'], 'js')]})
|
||||
|
||||
])
|
||||
@ -131,7 +135,7 @@ def initWebServer(options={}):
|
||||
if enable_https:
|
||||
protocol = "https"
|
||||
server = HTTPServer(app, no_keep_alive=True,
|
||||
ssl_options={"certfile": https_cert, "keyfile": https_key})
|
||||
ssl_options={"certfile": https_cert, "keyfile": https_key})
|
||||
else:
|
||||
protocol = "http"
|
||||
server = HTTPServer(app, no_keep_alive=True)
|
||||
@ -144,6 +148,7 @@ def initWebServer(options={}):
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
def shutdown():
|
||||
global server
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user