Tests: add live integration test (optional via PRIVATEBIN_IT), fix WinHTTP host/port + TLS opts, robust JSON parser (meta.time_to_live), CTest wiring; Add LLVM/clang-cl coverage option and docs; add build_thinkpad.bat; README updates

This commit is contained in:
mbusc
2025-08-28 15:22:00 +02:00
parent 7a125a4c9c
commit 0f58d40f52
10 changed files with 467 additions and 39 deletions

View File

@@ -105,8 +105,18 @@ bool JsonParser::parse_paste_json(const json& json_data,
}
}
// Extract expiration
expiration = json_data.at("meta").at("expire");
// Extract expiration; servers may return either meta.expire (string)
// or meta.time_to_live (integer seconds). Both are optional for our use.
try {
expiration = json_data.at("meta").at("expire");
} catch (...) {
try {
auto ttl = json_data.at("meta").at("time_to_live").get<int>();
expiration = std::to_string(ttl);
} catch (...) {
expiration.clear();
}
}
return true;
} catch (...) {