summaryrefslogtreecommitdiffstats
path: root/mailnews/compose/src/nsURLFetcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mailnews/compose/src/nsURLFetcher.cpp')
-rw-r--r--mailnews/compose/src/nsURLFetcher.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/mailnews/compose/src/nsURLFetcher.cpp b/mailnews/compose/src/nsURLFetcher.cpp
index b564ab9a4..ca2dcd7c6 100644
--- a/mailnews/compose/src/nsURLFetcher.cpp
+++ b/mailnews/compose/src/nsURLFetcher.cpp
@@ -7,7 +7,7 @@
#include "msgCore.h" // for pre-compiled headers
#include "nsCOMPtr.h"
-#include "nsNullPrincipal.h"
+#include "nsIScriptSecurityManager.h"
#include <stdio.h>
#include "nscore.h"
#include "nsIFactory.h"
@@ -317,15 +317,19 @@ nsURLFetcher::FireURLRequest(nsIURI *aURL, nsIFile *localFile, nsIOutputStream *
nsCOMPtr<nsIURILoader> pURILoader (do_GetService(NS_URI_LOADER_CONTRACTID));
NS_ENSURE_TRUE(pURILoader, NS_ERROR_FAILURE);
- nsCOMPtr<nsIPrincipal> nullPrincipal =
- do_CreateInstance("@mozilla.org/nullprincipal;1", &rv);
- NS_ENSURE_SUCCESS(rv, rv);
+ nsCOMPtr<nsIScriptSecurityManager>
+ secMan(do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv));
+ NS_ENSURE_SUCCESS(rv,rv);
+
+ nsCOMPtr<nsIPrincipal> systemPrincipal;
+ rv = secMan->GetSystemPrincipal(getter_AddRefs(systemPrincipal));
+ NS_ENSURE_SUCCESS(rv,rv);
nsCOMPtr<nsIChannel> channel;
rv = NS_NewChannel(getter_AddRefs(channel),
aURL,
- nullPrincipal,
- nsILoadInfo::SEC_NORMAL,
+ systemPrincipal,
+ nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
nsIContentPolicy::TYPE_OTHER,
nullptr, // aLoadGroup
this); // aCallbacks