No [Learn More] for HTTP header w/ a non-canonical case

RESOLVED FIXED in Firefox 54

Status

P2
normal
RESOLVED FIXED
2 years ago
9 months ago

People

(Reporter: teoli, Assigned: mail)

Tracking

unspecified
Firefox 54
Dependency tree / graph

Firefox Tracking Flags

(firefox54 fixed)

Details

(URL)

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

2 years ago
Since bug 1320233, a [Learn More] link is added in the Network Panel.

The link is added only next to the whitelisted HTTP Header. The comparison with these entries seems to be case-sensitive.

A [Learn More] link is not added next to Etag (Canonical case: ETag), x-xss-protection (Canonical case: X-XSS-Protection), or x-frame-options (canonical case: X-Frame-Options).

HTTP headers are not case sensistive, so we should be more lenient.
(Reporter)

Comment 1

2 years ago
I've added a link to https://irccloud.mozilla.com/ where these 3 specifics headers are not using the canonical case.
(Assignee)

Comment 2

2 years ago
I can look into this. I'll have a patch ready by the end of today.
Thanks Eduardo!
Honza
Priority: -- → P2
(Assignee)

Comment 4

2 years ago
Posted patch 1337737-v1.0.0.patch (obsolete) — Splinter Review
A day late, but here's the patch. This makes the header lookup case-insensitive.

On Try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=aa59bf25eb620d00ea4b52d1735d50ba426b2e46&selectedJob=76070868
Attachment #8835702 - Flags: review?(odvarko)
Comment on attachment 8835702 [details] [diff] [review]
1337737-v1.0.0.patch

Review of attachment 8835702 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the patch!

Just one inline comment

Honza

::: devtools/client/netmonitor/shared/components/headers-mdn.js
@@ +94,5 @@
> +  const lowerCaseHeader = header.toLowerCase();
> +
> +  let matchingHeaders = SUPPORTED_HEADERS.filter(supportedHeader => {
> +    return lowerCaseHeader === supportedHeader.toLowerCase();
> +  });

You don't have to iterate the entire array if you find first match so, it's better to use: Array.find()

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find

Honza
Attachment #8835702 - Flags: review?(odvarko)
(Assignee)

Comment 6

2 years ago
Good call! Here's the updated patch.

Thanks
Attachment #8835702 - Attachment is obsolete: true
Attachment #8836382 - Flags: review?(odvarko)
Comment on attachment 8836382 [details] [diff] [review]
1337737-v1.1.0.patch

Review of attachment 8836382 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good to me!

R+ assuming try is green

Thanks for the patch!
Honza
Attachment #8836382 - Flags: review?(odvarko) → review+
Keywords: checkin-needed

Comment 8

2 years ago
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b29e907e4fbb
Make lookup of MDN headers case-insensitive. r=Honza
Keywords: checkin-needed

Comment 9

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b29e907e4fbb
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox54: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 54

Updated

2 years ago
Blocks: 1339686

Updated

2 years ago
Assignee: nobody → mail

Updated

9 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.