BUG/MINOR: stats: add lang attribute to html tag

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
This commit is contained in:
Nicolas CARPi 2024-08-20 15:20:10 +02:00 committed by Willy Tarreau
parent 9318a624a1
commit bba679026c

View File

@ -60,7 +60,7 @@ void stats_dump_html_head(struct appctx *appctx)
/* WARNING! This must fit in the first buffer !!! */ /* WARNING! This must fit in the first buffer !!! */
chunk_appendf(chk, chunk_appendf(chk,
"<!DOCTYPE html>\n" "<!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" "<link rel=\"icon\" href=\"data:,\">\n"
"<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\">\n" "<meta http-equiv=\"content-type\" content=\"text/html; charset=iso-8859-1\">\n"
"<style type=\"text/css\"><!--\n" "<style type=\"text/css\"><!--\n"