Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
Tor Browser
Commits
9a28286b
Commit
9a28286b
authored
Jan 26, 2021
by
Dimi Lee
Browse files
Bug 1688871 - Fix remote query error. r=gcp, a=jcristau
Differential Revision:
https://phabricator.services.mozilla.com/D103036
parent
5676ec29
Changes
1
Hide whitespace changes
Inline
Side-by-side
toolkit/components/reputationservice/ApplicationReputation.cpp
View file @
9a28286b
...
...
@@ -22,6 +22,7 @@
#include "nsIURI.h"
#include "nsIURL.h"
#include "nsIUrlClassifierDBService.h"
#include "nsIURLFormatter.h"
#include "nsIX509Cert.h"
#include "nsIX509CertDB.h"
...
...
@@ -1567,9 +1568,13 @@ nsresult PendingLookup::SendRemoteQueryInternal(Reason& aReason) {
return
NS_ERROR_NOT_AVAILABLE
;
}
// If the remote lookup URL is empty or absent, bail.
nsAutoCString
serviceUrl
;
if
(
NS_FAILED
(
Preferences
::
GetCString
(
PREF_SB_APP_REP_URL
,
serviceUrl
))
||
serviceUrl
.
IsEmpty
())
{
nsString
serviceUrl
;
nsCOMPtr
<
nsIURLFormatter
>
formatter
(
do_GetService
(
"@mozilla.org/toolkit/URLFormatterService;1"
));
if
(
!
formatter
||
NS_FAILED
(
formatter
->
FormatURLPref
(
NS_ConvertASCIItoUTF16
(
PREF_SB_APP_REP_URL
),
serviceUrl
))
||
serviceUrl
.
IsEmpty
()
||
u"about:blank"
_ns
.
Equals
(
serviceUrl
))
{
LOG
((
"Remote lookup URL is empty or absent [this = %p]"
,
this
));
aReason
=
Reason
::
RemoteLookupDisabled
;
return
NS_ERROR_NOT_AVAILABLE
;
...
...
@@ -1678,7 +1683,7 @@ nsresult PendingLookup::SendRemoteQueryInternal(Reason& aReason) {
// Set up the channel to transmit the request to the service.
nsCOMPtr
<
nsIIOService
>
ios
=
do_GetService
(
NS_IOSERVICE_CONTRACTID
,
&
rv
);
rv
=
ios
->
NewChannel
(
serviceUrl
,
nullptr
,
nullptr
,
rv
=
ios
->
NewChannel
(
NS_ConvertUTF16toUTF8
(
serviceUrl
)
,
nullptr
,
nullptr
,
nullptr
,
// aLoadingNode
nsContentUtils
::
GetSystemPrincipal
(),
nullptr
,
// aTriggeringPrincipal
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment