diff --git a/.github/tour.sh b/.github/tour.sh index 3d145b5c..59cbef32 100755 --- a/.github/tour.sh +++ b/.github/tour.sh @@ -98,7 +98,7 @@ url_case ipfs bafkqacdjmrsw45djor4q ff483d1ff591898a9942916050d2ca3f 'Identity ( url_case ipfs baguqeerah2nswg7r2pvlpbnsz5y4c4pr4wsgbzixdl632w5qxvedqzryf54q 7750fd7b0928f007e1d181763c0dbdb5 'A DAG-JSON document. The block itself md5s to b92348005af4ae4795e6f312844fb359, but the response we are hashing here is an HTML preview page. This does mean this test breaks if you make the preview less ugly.' url_case ipns en.wikipedia-on-ipfs.org/I/HFE_Too_Slow_1.JPG.webp 09c09b2654e8529740b5a7625e39e0c8 'An image fetched through DNSLink and HAMT sharded directories.' note echo 'Skip as it takes too long.' url_case ipfs bafybeieb33pqideyl5ncd33kho622thym5rqv6sujrmelcuhkjlf2hdpu4/Big%20Buck%20Bunny.webm 06d51286e56badb4455594ebed6daba2 'A large UnixFS file - several hundred blocks.' error -url_case ipns k51qzi5uqu5dijv526o4z2z10ejylnel0bfvrtw53itcmsecffo8yf0zb4g9gi/symlinks/relative_link.txt cfe9b69523140b5b5e63874a8e4997e4 'A relative symlink resolves successfully to the file pointed to.' +url_case ipfs bafybeihmq5rnk5i4gwljixz64dns3pxt7ep2i3x7eylyfq7mkzgh4gtfh4/relative_link.txt cfe9b69523140b5b5e63874a8e4997e4 'A relative symlink resolves successfully to the file pointed to.' echo Stop test server. killall python3 2>/dev/null || true diff --git a/chromium_edits/129.0.6658.0/chrome/browser/shell_integration_mac.mm.patch b/chromium_edits/129.0.6658.0/chrome/browser/shell_integration_mac.mm.patch new file mode 100644 index 00000000..220e2546 --- /dev/null +++ b/chromium_edits/129.0.6658.0/chrome/browser/shell_integration_mac.mm.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/browser/shell_integration_mac.mm b/chrome/browser/shell_integration_mac.mm +index c6bb768979453..c0d0abb9c78f3 100644 +--- a/chrome/browser/shell_integration_mac.mm ++++ b/chrome/browser/shell_integration_mac.mm +@@ -79,6 +79,8 @@ bool SetAsDefaultBrowser() { + if (LSSetDefaultHandlerForURLScheme(CFSTR("https"), identifier) != noErr) { + return false; + } ++ LSSetDefaultHandlerForURLScheme(CFSTR("ipfs"), identifier); ++ LSSetDefaultHandlerForURLScheme(CFSTR("ipns"), identifier); + if (LSSetDefaultRoleHandlerForContentType(kUTTypeHTML, kLSRolesViewer, + identifier) != noErr) { + return false; diff --git a/chromium_edits/129.0.6658.0/chrome/installer/linux/common/desktop.template.patch b/chromium_edits/129.0.6658.0/chrome/installer/linux/common/desktop.template.patch new file mode 100644 index 00000000..dcd9460b --- /dev/null +++ b/chromium_edits/129.0.6658.0/chrome/installer/linux/common/desktop.template.patch @@ -0,0 +1,13 @@ +diff --git a/chrome/installer/linux/common/desktop.template b/chrome/installer/linux/common/desktop.template +index 2eb13ee1aba46..9af65726bde89 100644 +--- a/chrome/installer/linux/common/desktop.template ++++ b/chrome/installer/linux/common/desktop.template +@@ -111,7 +111,7 @@ Terminal=false + Icon=@@PACKAGE@@ + Type=Application + Categories=Network;WebBrowser; +-MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https; ++MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;x-scheme-handler/ipfs;x-scheme-handler/ipns; + Actions=new-window;new-private-window; + + [Desktop Action new-window] diff --git a/chromium_edits/129.0.6658.0/chrome/installer/util/shell_util.cc.patch b/chromium_edits/129.0.6658.0/chrome/installer/util/shell_util.cc.patch new file mode 100644 index 00000000..07096b83 --- /dev/null +++ b/chromium_edits/129.0.6658.0/chrome/installer/util/shell_util.cc.patch @@ -0,0 +1,20 @@ +diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc +index 183bf96be3741..116c5b838c8c5 100644 +--- a/chrome/installer/util/shell_util.cc ++++ b/chrome/installer/util/shell_util.cc +@@ -1526,11 +1526,12 @@ const wchar_t* ShellUtil::kDefaultFileAssociations[] = { + const wchar_t* ShellUtil::kPotentialFileAssociations[] = { + L".htm", L".html", L".pdf", L".shtml", L".svg", + L".xht", L".xhtml", L".webp", nullptr}; +-const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = {L"http", L"https", +- nullptr}; ++const wchar_t* ShellUtil::kBrowserProtocolAssociations[] = { ++ L"http", L"https", L"ipfs", L"ipns", nullptr}; + const wchar_t* ShellUtil::kPotentialProtocolAssociations[] = { + L"http", L"https", L"irc", L"mailto", L"mms", L"news", L"nntp", +- L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", nullptr}; ++ L"sms", L"smsto", L"snews", L"tel", L"urn", L"webcal", L"ipfs", ++ L"ipns", nullptr}; + const wchar_t* ShellUtil::kRegUrlProtocol = L"URL Protocol"; + const wchar_t* ShellUtil::kRegApplication = L"\\Application"; + const wchar_t* ShellUtil::kRegAppUserModelId = L"AppUserModelId"; diff --git a/cmake/patch.py b/cmake/patch.py index 11e3cf66..b911bdd2 100755 --- a/cmake/patch.py +++ b/cmake/patch.py @@ -440,6 +440,15 @@ def out_of_date(self, p): ): verbose(p, "Still relying on absl::optional in unit tests", file_path) return True + file_path = join(dir_path, "chrome/installer/linux/common/desktop.template.patch") + if not isfile(file_path): + verbose('No patching of', file_path) + return True + with open(file_path) as f: + lines = list(map(lambda x: x.strip(), f.readlines())) + if not any(map(lambda x: 'x-scheme-handler/ipfs' in x, lines)): + verbose(p, "No ipfs scheme in Linux installer", file_path) + return True file_path = f"{self.pdir}/{p}.patch" if not isfile(file_path): return False diff --git a/library/src/ipfs_client/gw/gateway_request_unittest.cc b/library/src/ipfs_client/gw/gateway_request_unittest.cc index cdaa8aa2..a730083b 100644 --- a/library/src/ipfs_client/gw/gateway_request_unittest.cc +++ b/library/src/ipfs_client/gw/gateway_request_unittest.cc @@ -116,3 +116,14 @@ TEST_F(GatewayRequestTest, timeouts_ordinal) { EXPECT_LT(timeout(RT::Providers), timeout(RT::Block)); EXPECT_LT(timeout(RT::Car), timeout(RT::Ipns)); } +TEST_F(GatewayRequestTest, describe_block_http) { + t_.type = RT::Block; + auto o = t_.describe_http("http://gate.way/"); + ASSERT_TRUE(o.has_value()); + auto& d = *o; + EXPECT_EQ(d.url, "http://gate.way/ipfs/main"); + EXPECT_EQ(d.accept, "application/vnd.ipld.raw"); + EXPECT_EQ(d.timeout_seconds, 32); + ASSERT_TRUE(d.max_response_size.has_value()); + EXPECT_EQ(d.max_response_size.value(), 2097152); +}