The request will not be sent with a foo header because the second open() call resets them.
It seems like the code in MockXMLHttpRequest is intending to do this but the implementation of req.headers() doesn't seem to be capable of actually removing existing headers this way.
In a real XHR, if you do something like
The request will not be sent with a
foo
header because the secondopen()
call resets them.It seems like the code in
MockXMLHttpRequest
is intending to do this but the implementation ofreq.headers()
doesn't seem to be capable of actually removing existing headers this way.