Reputation: 3463
does XMLHTTPRequest allow one to set "any" headers? Because it seems to be limiting me from setting the host header.
Upvotes: 5
Views: 1507
Reputation: 1280
No, as it will cause security issues. Please refer to W3C XMLHttpRequest Level 2 spec, the setRequestHeader() method should terminate if header is a case-insensitive match for one of the following headers:
Update: Konstantinos Filios is right that latest list can be found in WHATWG XMLHttprequest spec.
Upvotes: 9