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:
@@ -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 (...) {
|
||||
|
||||
Reference in New Issue
Block a user