Glob2Chan: Switch to Python 3.
parent
15bf5fcb78
commit
9dac3040b2
|
@ -52,7 +52,7 @@ class Glob2ChanCallback(httpserver.SupyHTTPServerCallback):
|
||||||
index and try out other plugins (if any)."""
|
index and try out other plugins (if any)."""
|
||||||
def doGet(self, handler, path):
|
def doGet(self, handler, path):
|
||||||
host = handler.address_string()
|
host = handler.address_string()
|
||||||
if host == 'localhost':
|
if host in ('localhost', '127.0.0.1', '::1'):
|
||||||
assert path.startswith('/status/')
|
assert path.startswith('/status/')
|
||||||
status = path[len('/status/'):].replace('/', ' ')
|
status = path[len('/status/'):].replace('/', ' ')
|
||||||
self.plugin._announce(ircutils.bold('[YOG]') +
|
self.plugin._announce(ircutils.bold('[YOG]') +
|
||||||
|
@ -60,12 +60,12 @@ class Glob2ChanCallback(httpserver.SupyHTTPServerCallback):
|
||||||
self.send_response(200)
|
self.send_response(200)
|
||||||
self.send_header('Content-type', 'text/plain')
|
self.send_header('Content-type', 'text/plain')
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
self.wfile.write('Channel notified.')
|
self.wfile.write(b'Channel notified.')
|
||||||
else:
|
else:
|
||||||
self.send_response(403)
|
self.send_response(403)
|
||||||
self.send_header('Content-type', 'text/plain')
|
self.send_header('Content-type', 'text/plain')
|
||||||
self.end_headers()
|
self.end_headers()
|
||||||
self.wfile.write('Not authorized.')
|
self.wfile.write(b'Not authorized.')
|
||||||
|
|
||||||
instance = None
|
instance = None
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue