mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-14 11:05:08 -05:00
Compare commits
5 commits
bdb0c99e17
...
088eddbb7b
Author | SHA1 | Date | |
---|---|---|---|
|
088eddbb7b | ||
|
693fadd9bc | ||
|
37e5e9f00b | ||
|
12b70db212 | ||
|
842b342dc5 |
5 changed files with 24 additions and 4 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
|
|
|
@ -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-_=";
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue