Updated the IPFS gateway to inbrowser.link and modified TranslateIPFSURI to support subdomain mode for SNS, ENS, and Unstoppable Domains. Introduced automatic conversion from CIDv0 to CIDv1 when subdomain routing mode is in use. Resolves: https://github.com/brave/brave-browser/issues/53690 --------- Signed-off-by: Vadym Struts <vstruts@brave.com>
24 lines
798 B
C++
24 lines
798 B
C++
/* Copyright (c) 2020 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/. */
|
|
|
|
#ifndef BRAVE_COMPONENTS_IPFS_IPFS_UTILS_H_
|
|
#define BRAVE_COMPONENTS_IPFS_IPFS_UTILS_H_
|
|
|
|
#include "base/containers/span.h"
|
|
#include "build/build_config.h"
|
|
#include "url/gurl.h"
|
|
|
|
namespace ipfs {
|
|
|
|
inline constexpr char kIPFSScheme[] = "ipfs";
|
|
inline constexpr char kDefaultPublicGateway[] = "https://inbrowser.link";
|
|
|
|
bool TranslateIPFSURI(const GURL& url, GURL* new_url, bool use_subdomain);
|
|
|
|
GURL ContentHashToCIDv1URL(base::span<const uint8_t> contenthash);
|
|
} // namespace ipfs
|
|
|
|
#endif // BRAVE_COMPONENTS_IPFS_IPFS_UTILS_H_
|