Skip to content

Commit

Permalink
check for invalid urls
Browse files Browse the repository at this point in the history
  • Loading branch information
bridiver committed Feb 1, 2019
1 parent c04de4d commit 07fd3df
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/brave_shields/browser/https_everywhere_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ bool HTTPSEverywhereService::GetHTTPSURL(
const GURL* url, const uint64_t& request_identifier,
std::string& new_url) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
base::ScopedBlockingCall scoped_blocking_call(
base::BlockingType::WILL_BLOCK);

if (!url->is_valid())
return false;

if (!IsInitialized() || !level_db_ || url->scheme() == url::kHttpsScheme) {
return false;
}
Expand Down Expand Up @@ -195,6 +197,9 @@ bool HTTPSEverywhereService::GetHTTPSURLFromCacheOnly(
const GURL* url,
const uint64_t& request_identifier,
std::string& cached_url) {
if (!url->is_valid())
return false;

if (!IsInitialized() || url->scheme() == url::kHttpsScheme) {
return false;
}
Expand Down

0 comments on commit 07fd3df

Please sign in to comment.