node-XMLHttpRequest
node-XMLHttpRequest copied to clipboard
A request header's default value can now be overwritten.
The default value of */* for the Accept header can cause undesirable behavior. For example, I am dealing with an API that can serve XML or JSON, but I cannot get it to return JSON due to the default value being first in the list. This change makes it so that if the setRequestHeader is called on a header that is currently set to its default value, it will overwrite the value instead of appending to it.