mirror of
https://github.com/moparisthebest/SickRage
synced 2024-11-05 17:05:03 -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')]})
|
||||
|
||||
])
|
||||
@ -144,6 +148,7 @@ def initWebServer(options={}):
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
def shutdown():
|
||||
global server
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user