mirror of
https://github.com/onionshare/onionshare.git
synced 2025-02-06 09:55:21 -05:00
Fix bug with shutdown_slug
This commit is contained in:
parent
72698a7247
commit
fee1d49563
@ -350,7 +350,7 @@ class Web(object):
|
|||||||
"""
|
"""
|
||||||
Stop the flask web server, from the context of an http request.
|
Stop the flask web server, from the context of an http request.
|
||||||
"""
|
"""
|
||||||
self.check_slug_candidate(slug_candidate, shutdown_slug)
|
self.check_slug_candidate(slug_candidate, self.shutdown_slug)
|
||||||
self.force_shutdown()
|
self.force_shutdown()
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
@ -472,10 +472,10 @@ class Web(object):
|
|||||||
try:
|
try:
|
||||||
s = socket.socket()
|
s = socket.socket()
|
||||||
s.connect(('127.0.0.1', port))
|
s.connect(('127.0.0.1', port))
|
||||||
s.sendall('GET /{0:s}/shutdown HTTP/1.1\r\n\r\n'.format(shutdown_slug))
|
s.sendall('GET /{0:s}/shutdown HTTP/1.1\r\n\r\n'.format(self.shutdown_slug))
|
||||||
except:
|
except:
|
||||||
try:
|
try:
|
||||||
urlopen('http://127.0.0.1:{0:d}/{1:s}/shutdown'.format(port, shutdown_slug)).read()
|
urlopen('http://127.0.0.1:{0:d}/{1:s}/shutdown'.format(port, self.shutdown_slug)).read()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user