Added support for multiple Loader headers

This commit is contained in:
jorbascrumps 2019-06-25 19:26:16 -04:00
parent 3bf3057da0
commit d88201604c

View file

@ -30,6 +30,14 @@ var XHRLoader = function (file, globalXHRSettings)
xhr.responseType = file.xhrSettings.responseType; xhr.responseType = file.xhrSettings.responseType;
xhr.timeout = config.timeout; xhr.timeout = config.timeout;
if (config.headers)
{
for (var key in config.headers)
{
xhr.setRequestHeader(key, config.headers[key]);
}
}
if (config.header && config.headerValue) if (config.header && config.headerValue)
{ {
xhr.setRequestHeader(config.header, config.headerValue); xhr.setRequestHeader(config.header, config.headerValue);