From f0d54a48bd75c87fc411a7425a11a3739410b56a Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Sat, 29 Dec 2007 11:09:43 +0000 Subject: [PATCH] prototype: Ensure Ajax.Response#getHeader returns null for missing headers. --- CHANGELOG | 2 ++ src/ajax.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) 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 } },