mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
httpserver: Fix favicon handling.
This commit is contained in:
parent
33262e125f
commit
048c1e77f4
@ -361,15 +361,15 @@ class Favicon(SupyHTTPServerCallback):
|
|||||||
file_path = conf.supybot.servers.http.favicon()
|
file_path = conf.supybot.servers.http.favicon()
|
||||||
found = False
|
found = False
|
||||||
if file_path:
|
if file_path:
|
||||||
|
response = None
|
||||||
try:
|
try:
|
||||||
icon = open(file_path, 'r')
|
icon = open(file_path, 'r')
|
||||||
found = True
|
response = icon.read()
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
icon.close()
|
icon.close()
|
||||||
if found:
|
if response is not None:
|
||||||
response = icon.read()
|
|
||||||
filename = file_path.rsplit(os.sep, 1)[1]
|
filename = file_path.rsplit(os.sep, 1)[1]
|
||||||
if '.' in filename:
|
if '.' in filename:
|
||||||
ext = filename.rsplit('.', 1)[1]
|
ext = filename.rsplit('.', 1)[1]
|
||||||
|
Loading…
Reference in New Issue
Block a user