diff --git a/src/calibre/library/server/content.py b/src/calibre/library/server/content.py index dd3a964c27..8ab44d27f3 100644 --- a/src/calibre/library/server/content.py +++ b/src/calibre/library/server/content.py @@ -44,6 +44,8 @@ class ContentServer(object): conditions=dict(method=["GET", "HEAD"])) connect('static', '/static/{name:.*?}', self.static, conditions=dict(method=["GET", "HEAD"])) + connect('favicon', '/favicon.png', self.favicon, + conditions=dict(method=["GET", "HEAD"])) # Utility methods {{{ def last_modified(self, updated): @@ -127,6 +129,13 @@ class ContentServer(object): ans = ans.replace('/static/', self.opts.url_prefix + '/static/') return ans + def favicon(self): + data = I('lt.png', data=True) + cherrypy.response.headers['Content-Type'] = 'image/png' + cherrypy.response.headers['Last-Modified'] = self.last_modified( + self.build_time) + return data + def index(self, **kwargs): 'The / URL' ua = cherrypy.request.headers.get('User-Agent', '').strip() diff --git a/src/calibre/library/server/opds.py b/src/calibre/library/server/opds.py index 8d1c555f3f..cfd0a837f7 100644 --- a/src/calibre/library/server/opds.py +++ b/src/calibre/library/server/opds.py @@ -55,6 +55,7 @@ E = ElementMaker(namespace='http://www.w3.org/2005/Atom', FEED = E.feed TITLE = E.title ID = E.id +ICON = E.icon def UPDATED(dt, *args, **kwargs): return E.updated(dt.strftime('%Y-%m-%dT%H:%M:%S+00:00'), *args, **kwargs) @@ -239,6 +240,7 @@ class Feed(object): # {{{ TITLE(title), AUTHOR(__appname__, uri='http://calibre-ebook.com'), ID(id_), + ICON('/favicon.png'), UPDATED(updated), SEARCH_LINK(self.base_href), START_LINK(href=self.base_href)