mirror of
https://github.com/moparisthebest/SickRage
synced 2024-12-13 03:22:22 -05:00
Added correct Content-Type header to showPoster calls.
This commit is contained in:
parent
c86aadca1e
commit
c449ca97e3
@ -234,7 +234,9 @@ class MainHandler(RequestHandler):
|
|||||||
func = getattr(klass, 'index', None)
|
func = getattr(klass, 'index', None)
|
||||||
|
|
||||||
if callable(func):
|
if callable(func):
|
||||||
return func(**args)
|
out = func(**args)
|
||||||
|
self._headers = klass._headers
|
||||||
|
return out
|
||||||
|
|
||||||
raise HTTPError(404)
|
raise HTTPError(404)
|
||||||
|
|
||||||
@ -279,9 +281,11 @@ class MainHandler(RequestHandler):
|
|||||||
image_file_name = cache_obj.banner_thumb_path(show)
|
image_file_name = cache_obj.banner_thumb_path(show)
|
||||||
|
|
||||||
if ek.ek(os.path.isfile, image_file_name):
|
if ek.ek(os.path.isfile, image_file_name):
|
||||||
|
self.set_header('Content-Type', 'image/jpeg')
|
||||||
with file(image_file_name, 'rb') as img:
|
with file(image_file_name, 'rb') as img:
|
||||||
return img.read()
|
return img.read()
|
||||||
|
|
||||||
|
self.set_header('Content-Type', 'image/png')
|
||||||
with file(default_image_path, 'rb') as img:
|
with file(default_image_path, 'rb') as img:
|
||||||
return img.read()
|
return img.read()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user