Compare commits

...

5 commits

Author SHA1 Message Date
altalk23
088eddbb7b c++ as well
Some checks failed
Build Binaries / Build Windows (push) Has been cancelled
Build Binaries / Build macOS (push) Has been cancelled
Build Binaries / Build Android (64-bit) (push) Has been cancelled
Build Binaries / Build Android (32-bit) (push) Has been cancelled
Build Binaries / Publish (push) Has been cancelled
2024-11-07 20:42:33 +03:00
altalk23
693fadd9bc i love clang sometimes 2024-11-07 20:41:05 +03:00
altalk23
37e5e9f00b update tuliphook 2024-11-07 20:29:37 +03:00
The Bearodactyl
12b70db212 add hashtag symbol to CommonFilter::Any (#1131) 2024-11-07 20:29:01 +03:00
Justin
842b342dc5 yeah... 2024-11-07 20:29:01 +03:00
5 changed files with 24 additions and 4 deletions

View file

@ -267,7 +267,7 @@ if (DEFINED GEODE_TULIPHOOK_REPO_PATH)
message(STATUS "Using ${GEODE_TULIPHOOK_REPO_PATH} for TulipHook")
add_subdirectory(${GEODE_TULIPHOOK_REPO_PATH} ${GEODE_TULIPHOOK_REPO_PATH}/build)
else()
CPMAddPackage("gh:geode-sdk/TulipHook#d1d9559")
CPMAddPackage("gh:geode-sdk/TulipHook#4e5d607")
endif()
set(CMAKE_WARN_DEPRECATED ON CACHE BOOL "" FORCE)

View file

@ -203,6 +203,15 @@ namespace geode::utils::web {
*/
WebRequest& followRedirects(bool enabled);
/**
* Enables or disables ignoring the content length header.
* The default is false.
*
* @param enabled
* @return WebRequest&
*/
WebRequest& ignoreContentLength(bool enabled);
/**
* Sets the Certificate Authority (CA) bundle content.
* Defaults to not sending a CA bundle.

View file

@ -416,8 +416,10 @@ Result<> ModMetadata::Impl::addSpecialFiles(file::Unzip& unzip) {
// unzip known MD files
for (auto& [file, target] : this->getSpecialFiles()) {
if (unzip.hasEntry(file)) {
GEODE_UNWRAP_INTO(auto data, unzip.extract(file).mapErr([&](auto const& err) {
return fmt::format("Unable to extract \"{}\": {}", file, err);
// reference to local binding 'file' declared in enclosing function
std::string_view fileStr(file);
GEODE_UNWRAP_INTO(auto data, unzip.extract(fileStr).mapErr([&](auto const& err) {
return fmt::format("Unable to extract \"{}\": {}", fileStr, err);
}));
*target = sanitizeDetailsData(std::string(data.begin(), data.end()));
}

View file

@ -47,7 +47,7 @@ const char* geode::getCommonFilterAllowedChars(CommonFilter filter) {
case CommonFilter::Float: return "-.0123456789";
case CommonFilter::ID: return "abcdefghijklmnopqrstuvwxyz0123456789-_.";
case CommonFilter::Name: return "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_ ";
case CommonFilter::Any: return "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-+/\\&$%^~*\'\"{}()[]<>=!?@,;.:|• ";
case CommonFilter::Any: return "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#_-+/\\&$%^~*\'\"{}()[]<>=!?@,;.:|• ";
case CommonFilter::Hex: return "0123456789abcdefABCDEF";
case CommonFilter::Base64Normal: return "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ+/=";
case CommonFilter::Base64URL: return "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_=";

View file

@ -202,6 +202,7 @@ public:
bool m_certVerification = true;
bool m_transferBody = true;
bool m_followRedirects = true;
bool m_ignoreContentLength = false;
std::string m_CABundleContent;
ProxyOpts m_proxyOpts = {};
HttpVersion m_httpVersion = HttpVersion::DEFAULT;
@ -382,6 +383,9 @@ WebTask WebRequest::send(std::string_view method, std::string_view url) {
// Follow request through 3xx responses
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, impl->m_followRedirects ? 1L : 0L);
// Ignore content length
curl_easy_setopt(curl, CURLOPT_IGNORE_CONTENT_LENGTH, impl->m_ignoreContentLength ? 1L : 0L);
// Track progress
curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 0);
@ -556,6 +560,11 @@ WebRequest& WebRequest::followRedirects(bool enabled) {
return *this;
}
WebRequest& WebRequest::ignoreContentLength(bool enabled) {
m_impl->m_ignoreContentLength = enabled;
return *this;
}
WebRequest& WebRequest::CABundleContent(std::string_view content) {
m_impl->m_CABundleContent = content;
return *this;