forked from openlp/openlp
fix code
This commit is contained in:
parent
19a2deef30
commit
7299aae51c
@ -150,7 +150,7 @@ class HttpRouter(RegistryProperties):
|
||||
self.routes = [
|
||||
('^/$', {'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}),
|
||||
(r'^/files/(.*)$', {'function': self.serve_file, '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)
|
||||
parts = file_name.split('/')
|
||||
if len(parts) == 3:
|
||||
file_name = parts[0] + '/' + parts[2]
|
||||
if len(parts) == 1:
|
||||
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))
|
||||
print(path)
|
||||
if not path.startswith(self.config_dir):
|
||||
return self.do_not_found()
|
||||
content = None
|
||||
|
@ -167,7 +167,7 @@ class HTTPSServer(HTTPServer):
|
||||
local_data = AppLocation.get_directory(AppLocation.DataDir)
|
||||
self.socket = ssl.SSLSocket(
|
||||
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'),
|
||||
keyfile=os.path.join(local_data, 'remotes', 'openlp.key'),
|
||||
server_side=True)
|
||||
|
Loading…
Reference in New Issue
Block a user