Skip to content

Commit b586fcf

Browse files
committed
tinyhttps 0.3.5
1 parent b2f1e69 commit b586fcf

3 files changed

Lines changed: 34 additions & 2 deletions

File tree

‎pkgs/t/tinyhttps.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ package = {
117117
},
118118
sha256 = "26e0e496e053324e76ab7fc13f6fc6613a7e4ba498f3365575a80daf540941e9",
119119
},
120+
["0.3.5"] = {
121+
url = {
122+
GLOBAL = "https://github.com/mcpplibs/tinyhttps/archive/refs/tags/0.3.5.tar.gz",
123+
CN = "https://gitcode.com/mcpp-res/tinyhttps/releases/download/0.3.5/tinyhttps-0.3.5.tar.gz",
124+
},
125+
sha256 = "6f75f9e6a630ee44df75b1c3e5af21791f449966999cabd778586834183558a3",
126+
},
120127
},
121128
macosx = {
122129
["0.2.1"] = {
@@ -224,6 +231,13 @@ package = {
224231
},
225232
sha256 = "26e0e496e053324e76ab7fc13f6fc6613a7e4ba498f3365575a80daf540941e9",
226233
},
234+
["0.3.5"] = {
235+
url = {
236+
GLOBAL = "https://github.com/mcpplibs/tinyhttps/archive/refs/tags/0.3.5.tar.gz",
237+
CN = "https://gitcode.com/mcpp-res/tinyhttps/releases/download/0.3.5/tinyhttps-0.3.5.tar.gz",
238+
},
239+
sha256 = "6f75f9e6a630ee44df75b1c3e5af21791f449966999cabd778586834183558a3",
240+
},
227241
},
228242
windows = {
229243
["0.2.1"] = {
@@ -331,6 +345,13 @@ package = {
331345
},
332346
sha256 = "26e0e496e053324e76ab7fc13f6fc6613a7e4ba498f3365575a80daf540941e9",
333347
},
348+
["0.3.5"] = {
349+
url = {
350+
GLOBAL = "https://github.com/mcpplibs/tinyhttps/archive/refs/tags/0.3.5.tar.gz",
351+
CN = "https://gitcode.com/mcpp-res/tinyhttps/releases/download/0.3.5/tinyhttps-0.3.5.tar.gz",
352+
},
353+
sha256 = "6f75f9e6a630ee44df75b1c3e5af21791f449966999cabd778586834183558a3",
354+
},
334355
},
335356
},
336357
}

‎tests/examples/tinyhttps/mcpp.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ name = "tinyhttps-tests"
1010
version = "0.1.0"
1111

1212
[dependencies]
13-
tinyhttps = "0.3.4"
13+
tinyhttps = "0.3.5"

‎tests/examples/tinyhttps/tests/api.cpp‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ int main() {
3131
const auto cancelledDownload = client.download_to_file(
3232
"https://example.invalid/file", "tinyhttps-unused", nullptr, nullptr,
3333
stopped.get_token());
34+
// 0.3.5: roots added to the default store, empty unless set, and a TLS
35+
// handshake that has a time limit. The pointer names the new parameter,
36+
// which is the one source change the release asks of anyone.
37+
HttpClientConfig extra;
38+
const bool extraUnset = extra.extraCaFile.empty();
39+
extra.extraCaFile = "/etc/corp/root-ca.pem";
40+
HttpClient withExtra(extra);
41+
bool (TlsSocket::*connectOver)(Socket&&, const char*, bool, int) = &TlsSocket::connect_over;
3442
const bool ok = request.method == Method::POST
3543
&& request.url == "https://example.invalid/data"
3644
&& request.body == "{\"ok\":true}"
@@ -51,6 +59,9 @@ int main() {
5159
&& cancelled.statusCode == 0
5260
&& !cancelled.ok()
5361
&& cancelledDownload.cancelled
54-
&& !cancelledDownload.ok();
62+
&& !cancelledDownload.ok()
63+
&& extraUnset // 0.3.5
64+
&& extra.extraCaFile == "/etc/corp/root-ca.pem"
65+
&& connectOver != nullptr;
5566
return ok ? 0 : 1;
5667
}

0 commit comments

Comments
 (0)