diff --git a/packages/hint-highest-available-document-mode/README.md b/packages/hint-highest-available-document-mode/README.md index aa372d3c1b2..9e2bf48f8f5 100644 --- a/packages/hint-highest-available-document-mode/README.md +++ b/packages/hint-highest-available-document-mode/README.md @@ -46,10 +46,23 @@ Notes: ## What does the hint check? -By default, the hint checks if the `X-UA-Compatible` response header -is sent with the value of `IE=edge`, and that the `meta` tag isn’t -used. +### Important note about case-sensitivity +The `X-UA-Compatible` header is defined as case-insensitive according to Microsoft's specification. + +The hint now correctly performs a **case-insensitive comparison** of the value. +This means the following are all treated as valid: + + X-UA-Compatible: IE=edge + X-UA-Compatible: Ie=EdGe + x-ua-compatible: ie=edge + +Only values that are not equal to `ie=edge` (ignoring case and spacing) +will trigger an error. + +```text +X-UA-Compatible: IE=edge +``` ### Examples that **trigger** the hint for defaults `X-UA-Compatible` response header is not sent: diff --git a/packages/hint-highest-available-document-mode/src/hint.ts b/packages/hint-highest-available-document-mode/src/hint.ts index b697c20085d..df7d349e2ce 100644 --- a/packages/hint-highest-available-document-mode/src/hint.ts +++ b/packages/hint-highest-available-document-mode/src/hint.ts @@ -80,7 +80,7 @@ export default class HighestAvailableDocumentModeHint implements IHint { return; } - if (headerValue !== 'ie=edge') { + if (headerValue?.trim().toLowerCase() !== 'ie=edge') { context.report( resource, getMessage('headerValueShouldBe', context.language),