diff --git a/modules/libjar/nsJARChannel.cpp b/modules/libjar/nsJARChannel.cpp index e100cebb247..b6ea7058042 100644 --- a/modules/libjar/nsJARChannel.cpp +++ b/modules/libjar/nsJARChannel.cpp @@ -989,15 +989,10 @@ nsJARChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctx) NS_IMETHODIMP nsJARChannel::AsyncOpen2(nsIStreamListener *aListener) { - if (!mLoadInfo) { - MOZ_ASSERT(mLoadInfo, "can not enforce security without loadInfo"); - return NS_ERROR_UNEXPECTED; - } - // setting the flag on the loadInfo indicates that the underlying - // channel will be openend using AsyncOpen2() and hence performs - // the necessary security checks. - mLoadInfo->SetEnforceSecurity(true); - return AsyncOpen(aListener, nullptr); + nsCOMPtr listener = aListener; + nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener); + NS_ENSURE_SUCCESS(rv, rv); + return AsyncOpen(listener, nullptr); } nsresult