Skip to content

Commit

Permalink
Add base64 encoded favicon to html output
Browse files Browse the repository at this point in the history
If html file didn't have a icon link,browser may request a facicon.ico
from the root uri which may not have on the server, and it will return
a 404 error code.
this might not work for browsers lower than IE8

Fix allinurl#1432
  • Loading branch information
dragonandy committed Apr 26, 2019
1 parent 1ab70d7 commit 123c9e7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/output.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,16 @@ print_html_header (FILE * fp)
"<meta name='viewport' content='width=device-width, initial-scale=1'>"
"<meta name='robots' content='noindex, nofollow'>", _(DOC_LANG));

/* Output base64 encoded goaccess favicon.ico*/
fprintf (fp, "<link rel='icon' href='data:image/x-icon;base64,AAABAAEA"
"EBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAgAAAAAAAAAAAAAAAEAAAA"
"AAAAADGxsYAWFhYABwcHABfAP8A/9dfAADXrwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAIiIiIiIiIiIjMlUkQgAiIiIiIiIiIiIiIzJVJEIAAAIiIiI"
"iIiIiIiMyVSRCAAIiIiIiIiIiIiIRERERERERERERERERERERIiIiIiIiIiIgACVVUiIi"
"IiIiIiIiIiIiIAAlVVIiIiIiIiIiIiIiIhEREREREREREREREREREREAAAAAAAAAAAAAA"
"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
"AA' type='image/x-icon' />");

print_html_title (fp);

fprintf (fp, "<style>%s</style>", fa_css);
Expand Down

0 comments on commit 123c9e7

Please sign in to comment.