Files
brave-core/net/base/url_util.cc
T
Jocelyn Liu 9e341ca3aa Allow only HTTPS URLs or HTTP localhost URLs for rpc, icon, and explorer URLs
Only use those URLs in:
- ParseChainList for registry
- JsonRPCService::AddChain
2024-06-18 09:45:35 -07:00

20 lines
593 B
C++

/* Copyright (c) 2024 The Brave Authors. All rights reserved.
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at https://mozilla.org/MPL/2.0/. */
#include "brave/net/base/url_util.h"
#include "net/base/url_util.h"
#include "url/url_constants.h"
namespace net {
bool IsHTTPSOrLocalhostURL(const GURL& url) {
return url.is_valid() &&
(url.SchemeIs(url::kHttpsScheme) ||
(IsLocalhost(url) && url.SchemeIs(url::kHttpScheme)));
}
} // namespace net