Knu Knu - 1 year ago 79
Javascript Question

Polyfill to list the HTTP headers of a Header's instance

Certain versions¹ of Firefox support

but lack

How to go through all key/value pairs of a
' instance in an ES5-compatible² and elegant³ way on these browsers?

be extended?

¹ 34–43

² no for…of

³ no brute force

⁴ supported since version 47

Answer Source

Before Firefox 44 (which added .keys/entries/values on Headers), there was no non-brute-force way to find out what set of headers were actually set in the object. The information simply isn't exposed anywhere.

That said, releases prior to Firefox 45 (the current ESR release) are all out of support and have known security bugs, so users should really not be using those. I don't think it's worth catering to users on those releases; they should be urged to update instead.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download