]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stats: add lang attribute to html tag
authorNicolas CARPi <nico-git@deltablot.email>
Tue, 20 Aug 2024 13:20:10 +0000 (15:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Aug 2024 13:55:45 +0000 (15:55 +0200)
The "html" element of the stats page was missing a "lang" attribute.
This change specifies the "en" value, which corresponds to english
language.

It is also a required element for WCAG Success Criterion 3.1.1, which
renders the web more accessible through a set of requirements. In this
case it allows assistive technologies such as screen readers to
determine the language of the page.

MDN page: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang
HTML standard: https://html.spec.whatwg.org/multipage/dom.html#attr-lang
WCAG criterion: https://www.w3.org/WAI/WCAG22/Understanding/language-of-page.html

src/stats-html.c

index c69fb9d2a7b6788fd16bba3d99b26dd1dabc3f35..23cfb91a0d3cf7846d11bdbd8a8ca15d0e176a25 100644 (file)
@@ -60,7 +60,7 @@ void stats_dump_html_head(struct appctx *appctx)
        /* WARNING! This must fit in the first buffer !!! */
        chunk_appendf(chk,
                      "<!DOCTYPE html>\n"
-                     "<html><head><title>Statistics Report for " PRODUCT_NAME "%s%s</title>\n"
+                     "<html lang=\"en\"><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"