]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stats: prevent favicon.ico requests for stats page
authorzurikus <sergioko@inbox.lv>
Tue, 18 Aug 2020 08:16:05 +0000 (11:16 +0300)
committerWilly Tarreau <w@1wt.eu>
Wed, 19 Aug 2020 09:29:57 +0000 (11:29 +0200)
Haproxy stats page don't have a favicon.ico, but browsers always makes a request for it.
This lead to errors during stats page requests:

Aug 18 08:46:41 somehost.example.net haproxy[1521534]: X.X.X.X:61403 [18/Aug/2020:08:46:41.437] stats stats/ -1/-1/-1/-1/0 503 222 - - SC-- 2/2/0/0/0 0/0 "GET /favicon.ico HTTP/1.1"
Aug 18 08:46:42 somehost.example.net haproxy[1521534]: X.X.X.X:61403 [18/Aug/2020:08:46:42.650] stats stats/ -1/-1/-1/-1/0 503 222 - - SC-- 2/2/0/0/0 0/0 "GET /favicon.ico HTTP/1.1"

Patch provided disables favicon.ico requests for haproxy stats page.

src/stats.c

index 5248a6c2f9f03dd77219e4046e24ad09c3e101b5..36aee99f9a864b2ed894027123d0717a0b2b5fbd 100644 (file)
@@ -2335,6 +2335,7 @@ static void stats_dump_html_head(struct appctx *appctx, struct uri_auth *uri)
                      "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"\n"
                      "\"http://www.w3.org/TR/html4/loose.dtd\">\n"
                      "<html><head><title>Statistics Report for " PRODUCT_NAME "%s%s</title>\n"
+                     "<link rel=\"icon\" href=\"data:,\">\n"
                      "<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\">\n"
                      "<style type=\"text/css\"><!--\n"
                      "body {"