0

HTML code of loading favicon is delow.

<link rel="icon" href="favicon.ico" id="favicon" />

Server side script return favicon file is below.

@app.route('/favicon.ico')
def faviconindex():
    with open('chalicelib/static/images/favicon.ico', 'rb') as fp:
        data = fp.read()
    return Response(body=data, status_code=200, headers={"Content-Type": "image/x-icon", "Access-Control-Allow-Origin": "*"})

Do you know why favicon is not displayed?

stone
  • 11
  • 3
  • I don't use AWS but why not use `href="/static/images/favicon.ico"` instead of `href="favicon.ico"` ? – furas Oct 05 '22 at 22:23
  • don't you get error message when you send it? Did you check in `DevTools` in `Chrome`/`Firefox` (tab: `Network`) it get this file from server? OR maybe it needs absolute path with `/` - `href="/favicon.ico"` – furas Oct 05 '22 at 22:31

0 Answers0