diff --git a/CHANGELOG b/CHANGELOG index 86a1cd6..c6caabe 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Ensure Ajax.Response#getHeader returns null for missing headers. [Tobie Langel] + * Ensure $A creates an empty array when its argument's length is undefined. Closes #10574. [henryju, Tobie Langel] * Fix incorrect variable declaration in Event.fire. Closes #10329. [rubley] diff --git a/src/ajax.js b/src/ajax.js index dc1aa99..90c4a83 100644 --- a/src/ajax.js +++ b/src/ajax.js @@ -209,7 +209,8 @@ Ajax.Request = Class.create(Ajax.Base, { getHeader: function(name) { try { - return this.transport.getResponseHeader(name); + var header = this.transport.getResponseHeader(name); + return Object.isUndefined(header) ? null : header; } catch (e) { return null } },