Make sure config.headers does not overwrite DEFAULT_CONFIG.headers in OpenLayers.Request.issue

This commit is contained in:
Bart van den Eijnden
2012-11-13 09:43:31 +01:00
parent 57e22ef491
commit 3265b0e73f
2 changed files with 32 additions and 2 deletions

View File

@@ -173,8 +173,10 @@ OpenLayers.Util.extend(OpenLayers.Request, {
this.DEFAULT_CONFIG,
{proxy: OpenLayers.ProxyHost}
);
config = config || {};
config.headers = config.headers || {};
config = OpenLayers.Util.applyDefaults(config, defaultConfig);
config.headers = OpenLayers.Util.applyDefaults(config.headers, defaultConfig.headers);
// Always set the "X-Requested-With" header to signal that this request
// was issued through the XHR-object. Since header keys are case
// insensitive and we want to allow overriding of the "X-Requested-With"