From d2a0b67a863b0f8f7878ba0f929bcc524f387d23 Mon Sep 17 00:00:00 2001 From: rajucreate Date: Tue, 25 Nov 2025 19:39:41 +0530 Subject: [PATCH 1/2] fix: correct case-sensitivity behavior in highest-available-document-mode hint docs and logic --- .../README.md | 17 +++++++++++++++++ .../src/hint.ts | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/packages/hint-highest-available-document-mode/README.md b/packages/hint-highest-available-document-mode/README.md index aa372d3c1b2..81d3b86dc08 100644 --- a/packages/hint-highest-available-document-mode/README.md +++ b/packages/hint-highest-available-document-mode/README.md @@ -46,6 +46,23 @@ Notes: ## What does the hint check? +### Important note about case-sensitivity + +Although the `X-UA-Compatible` header is defined as case-insensitive +according to Microsoft's specification, the current implementation of +this hint performs a **case-sensitive** comparison against the value +`ie=edge`. + +This means that a valid header like: + +```text +X-UA-Compatible: IE=edge +``` +may incorrectly trigger this hint. + +This is a known limitation of the current behavior. For reference, see: +https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/compatibility/jj676915(v=vs.85) + 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. 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), From 8be06e046778bf2e73627699ea4586122f5dbc11 Mon Sep 17 00:00:00 2001 From: rajucreate Date: Tue, 25 Nov 2025 19:49:48 +0530 Subject: [PATCH 2/2] ' --- .../README.md | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/packages/hint-highest-available-document-mode/README.md b/packages/hint-highest-available-document-mode/README.md index 81d3b86dc08..9e2bf48f8f5 100644 --- a/packages/hint-highest-available-document-mode/README.md +++ b/packages/hint-highest-available-document-mode/README.md @@ -48,25 +48,21 @@ Notes: ### Important note about case-sensitivity -Although the `X-UA-Compatible` header is defined as case-insensitive -according to Microsoft's specification, the current implementation of -this hint performs a **case-sensitive** comparison against the value -`ie=edge`. +The `X-UA-Compatible` header is defined as case-insensitive according to Microsoft's specification. -This means that a valid header like: +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 ``` -may incorrectly trigger this hint. - -This is a known limitation of the current behavior. For reference, see: -https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/compatibility/jj676915(v=vs.85) - -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. - ### Examples that **trigger** the hint for defaults `X-UA-Compatible` response header is not sent: