summaryrefslogtreecommitdiffstats
path: root/mailnews/compose/src/nsURLFetcher.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-11-10 17:25:51 -0500
committerMatt A. Tobin <email@mattatobin.com>2019-11-10 17:25:51 -0500
commitbbf10b90975bc11e5ea2ac70196615a041b00f6f (patch)
tree23dc6572ef3c31de044661425de06df75b92d103 /mailnews/compose/src/nsURLFetcher.cpp
parentb0e23e79e72b7892b826fabea4f9e02c421d2861 (diff)
downloadUXP-bbf10b90975bc11e5ea2ac70196615a041b00f6f.tar
UXP-bbf10b90975bc11e5ea2ac70196615a041b00f6f.tar.gz
UXP-bbf10b90975bc11e5ea2ac70196615a041b00f6f.tar.lz
UXP-bbf10b90975bc11e5ea2ac70196615a041b00f6f.tar.xz
UXP-bbf10b90975bc11e5ea2ac70196615a041b00f6f.zip
Bug 1328847 - Change SEC_NORMAL to SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL where system principal is used.
Tag #1273
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