Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions packages/hint-highest-available-document-mode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
Loading