From XMLHttpRequest there is a set of headers that cannot be set. Take a look at the spec for setRequestHeader () . Date is one of these headers.
Also, if you look at the source code of WebKit , you can see this in the implementation.
bool XMLHttpRequest::isAllowedHTTPHeader(const String& name) { initializeXMLHttpRequestStaticData(); return !staticData->m_forbiddenRequestHeaders.contains(name) && !name.startsWith(staticData->m_proxyHeaderPrefix, false) && !name.startsWith(staticData->m_secHeaderPrefix, false); }
source share