Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions pkgs/t/tinyhttps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ package = {
},
sha256 = "26e0e496e053324e76ab7fc13f6fc6613a7e4ba498f3365575a80daf540941e9",
},
["0.3.5"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/tinyhttps/archive/refs/tags/0.3.5.tar.gz",
CN = "https://gitcode.com/mcpp-res/tinyhttps/releases/download/0.3.5/tinyhttps-0.3.5.tar.gz",
},
sha256 = "6f75f9e6a630ee44df75b1c3e5af21791f449966999cabd778586834183558a3",
},
},
macosx = {
["0.2.1"] = {
Expand Down Expand Up @@ -224,6 +231,13 @@ package = {
},
sha256 = "26e0e496e053324e76ab7fc13f6fc6613a7e4ba498f3365575a80daf540941e9",
},
["0.3.5"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/tinyhttps/archive/refs/tags/0.3.5.tar.gz",
CN = "https://gitcode.com/mcpp-res/tinyhttps/releases/download/0.3.5/tinyhttps-0.3.5.tar.gz",
},
sha256 = "6f75f9e6a630ee44df75b1c3e5af21791f449966999cabd778586834183558a3",
},
},
windows = {
["0.2.1"] = {
Expand Down Expand Up @@ -331,6 +345,13 @@ package = {
},
sha256 = "26e0e496e053324e76ab7fc13f6fc6613a7e4ba498f3365575a80daf540941e9",
},
["0.3.5"] = {
url = {
GLOBAL = "https://github.com/mcpplibs/tinyhttps/archive/refs/tags/0.3.5.tar.gz",
CN = "https://gitcode.com/mcpp-res/tinyhttps/releases/download/0.3.5/tinyhttps-0.3.5.tar.gz",
},
sha256 = "6f75f9e6a630ee44df75b1c3e5af21791f449966999cabd778586834183558a3",
},
},
},
}
2 changes: 1 addition & 1 deletion tests/examples/tinyhttps/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ name = "tinyhttps-tests"
version = "0.1.0"

[dependencies]
tinyhttps = "0.3.4"
tinyhttps = "0.3.5"
13 changes: 12 additions & 1 deletion tests/examples/tinyhttps/tests/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@ int main() {
const auto cancelledDownload = client.download_to_file(
"https://example.invalid/file", "tinyhttps-unused", nullptr, nullptr,
stopped.get_token());
// 0.3.5: roots added to the default store, empty unless set, and a TLS
// handshake that has a time limit. The pointer names the new parameter,
// which is the one source change the release asks of anyone.
HttpClientConfig extra;
const bool extraUnset = extra.extraCaFile.empty();
extra.extraCaFile = "/etc/corp/root-ca.pem";
HttpClient withExtra(extra);
bool (TlsSocket::*connectOver)(Socket&&, const char*, bool, int) = &TlsSocket::connect_over;
const bool ok = request.method == Method::POST
&& request.url == "https://example.invalid/data"
&& request.body == "{\"ok\":true}"
Expand All @@ -51,6 +59,9 @@ int main() {
&& cancelled.statusCode == 0
&& !cancelled.ok()
&& cancelledDownload.cancelled
&& !cancelledDownload.ok();
&& !cancelledDownload.ok()
&& extraUnset // 0.3.5
&& extra.extraCaFile == "/etc/corp/root-ca.pem"
&& connectOver != nullptr;
return ok ? 0 : 1;
}
Loading