From 1ddc98a819ea2937adab5ff0b6a79f2fa589bc54 Mon Sep 17 00:00:00 2001 From: marcelduran Date: Sat, 2 Mar 2013 22:39:38 -0800 Subject: [PATCH] normalized yql response which introduced a *result* into headers, thanks @souders for the catch --- CHANGELOG | 4 ++++ src/bookmarklet/controller.js | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index e3d10ab..2b81627 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,7 @@ +Version 3.1.6 +------------- +* Fixed bookmarklet yql response *result* on headers. Thanks @souders + Version 3.1.5 ------------- * Added onerror handler to PhantomJS diff --git a/src/bookmarklet/controller.js b/src/bookmarklet/controller.js index ff237b9..ff1f530 100644 --- a/src/bookmarklet/controller.js +++ b/src/bookmarklet/controller.js @@ -225,6 +225,9 @@ YUI().use(function (iY) { arrayEach(redir, function (red) { var headers = {}; + // normalize headers, yql introduced result in response + red.headers = red.headers.result || red.headers; + objEach(red.headers, function (value, key) { headers[key.toLowerCase()] = value; }); @@ -242,6 +245,9 @@ YUI().use(function (iY) { } comp.href = comp.url = v.url; + // normalize headers, yql introduced result in response + v.headers = v.headers.result || v.headers; + // build raw headers objEach(v.headers, function (v, k) { rawHeaders += k + ': ' + v + '\n';