Check responseHeaders length before calling pop() (#1739)

This throws an error on Firefox when responseHeaders is 0-length
This commit is contained in:
dhowe 2016-06-20 21:28:40 +08:00 committed by Raymond Hill
parent 8c632db436
commit 77da1aabb3

View file

@ -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,