From 77da1aabb3c34b30ca84338efbde0d359adb6d65 Mon Sep 17 00:00:00 2001 From: dhowe Date: Mon, 20 Jun 2016 21:28:40 +0800 Subject: [PATCH] Check responseHeaders length before calling pop() (#1739) This throws an error on Firefox when responseHeaders is 0-length --- platform/firefox/vapi-background.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 15d98726a..9239578b8 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -2108,7 +2108,7 @@ var httpObserver = { return; } - if ( result.responseHeaders ) { + if ( result.responseHeaders && result.responseHeaders.length ) { channel.setResponseHeader( 'Content-Security-Policy', result.responseHeaders.pop().value,