forked from openlp/openlp
fix code
This commit is contained in:
parent
19a2deef30
commit
7299aae51c
@ -150,7 +150,7 @@ class HttpRouter(RegistryProperties):
|
|||||||
self.routes = [
|
self.routes = [
|
||||||
('^/$', {'function': self.serve_file, 'secure': False}),
|
('^/$', {'function': self.serve_file, 'secure': False}),
|
||||||
('^/(stage)$', {'function': self.serve_file, 'secure': False}),
|
('^/(stage)$', {'function': self.serve_file, 'secure': False}),
|
||||||
('^/(stage)/(.*)$', {'function': self.stages, 'secure': False}),
|
('^/(stages)/(.*)$', {'function': self.stages, 'secure': False}),
|
||||||
('^/(main)$', {'function': self.serve_file, 'secure': False}),
|
('^/(main)$', {'function': self.serve_file, 'secure': False}),
|
||||||
(r'^/files/(.*)$', {'function': self.serve_file, 'secure': False}),
|
(r'^/files/(.*)$', {'function': self.serve_file, 'secure': False}),
|
||||||
(r'^/(\w+)/thumbnails([^/]+)?/(.*)$', {'function': self.serve_thumbnail, 'secure': False}),
|
(r'^/(\w+)/thumbnails([^/]+)?/(.*)$', {'function': self.serve_thumbnail, 'secure': False}),
|
||||||
@ -352,10 +352,12 @@ class HttpRouter(RegistryProperties):
|
|||||||
"""
|
"""
|
||||||
log.debug('serve file request %s' % file_name)
|
log.debug('serve file request %s' % file_name)
|
||||||
parts = file_name.split('/')
|
parts = file_name.split('/')
|
||||||
if len(parts) == 3:
|
if len(parts) == 1:
|
||||||
file_name = parts[0] + '/' + parts[2]
|
file_name = parts[0] + '/stage.html'
|
||||||
|
elif len(parts) == 3:
|
||||||
|
print(parts)
|
||||||
|
file_name = parts[1] + '/' + parts[2]
|
||||||
path = os.path.normpath(os.path.join(self.config_dir, file_name))
|
path = os.path.normpath(os.path.join(self.config_dir, file_name))
|
||||||
print(path)
|
|
||||||
if not path.startswith(self.config_dir):
|
if not path.startswith(self.config_dir):
|
||||||
return self.do_not_found()
|
return self.do_not_found()
|
||||||
content = None
|
content = None
|
||||||
|
@ -167,7 +167,7 @@ class HTTPSServer(HTTPServer):
|
|||||||
local_data = AppLocation.get_directory(AppLocation.DataDir)
|
local_data = AppLocation.get_directory(AppLocation.DataDir)
|
||||||
self.socket = ssl.SSLSocket(
|
self.socket = ssl.SSLSocket(
|
||||||
sock=socket.socket(self.address_family, self.socket_type),
|
sock=socket.socket(self.address_family, self.socket_type),
|
||||||
ssl_version=ssl.PROTOCOL_TLSv1,
|
ssl_version=ssl.PROTOCOL_TLSv1_2,
|
||||||
certfile=os.path.join(local_data, 'remotes', 'openlp.crt'),
|
certfile=os.path.join(local_data, 'remotes', 'openlp.crt'),
|
||||||
keyfile=os.path.join(local_data, 'remotes', 'openlp.key'),
|
keyfile=os.path.join(local_data, 'remotes', 'openlp.key'),
|
||||||
server_side=True)
|
server_side=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user