impit 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {impit-0.2.0 → impit-0.2.1}/Cargo.lock +73 -74
  2. {impit-0.2.0 → impit-0.2.1}/PKG-INFO +1 -1
  3. {impit-0.2.0 → impit-0.2.1}/impit/src/http_headers/mod.rs +21 -25
  4. {impit-0.2.0 → impit-0.2.1}/impit/src/impit.rs +13 -1
  5. {impit-0.2.0 → impit-0.2.1}/impit-python/test/async_test.py +17 -0
  6. {impit-0.2.0 → impit-0.2.1}/impit-python/test/basic_test.py +15 -0
  7. {impit-0.2.0 → impit-0.2.1}/impit-python/uv.lock +183 -183
  8. {impit-0.2.0 → impit-0.2.1}/pyproject.toml +1 -1
  9. {impit-0.2.0 → impit-0.2.1}/Cargo.toml +0 -0
  10. {impit-0.2.0 → impit-0.2.1}/README.md +0 -0
  11. {impit-0.2.0 → impit-0.2.1}/impit/Cargo.toml +0 -0
  12. {impit-0.2.0 → impit-0.2.1}/impit/README.md +0 -0
  13. {impit-0.2.0 → impit-0.2.1}/impit/docs/index.html +0 -0
  14. {impit-0.2.0 → impit-0.2.1}/impit/examples/basic.rs +0 -0
  15. {impit-0.2.0 → impit-0.2.1}/impit/src/http3.rs +0 -0
  16. {impit-0.2.0 → impit-0.2.1}/impit/src/http_headers/statics.rs +0 -0
  17. {impit-0.2.0 → impit-0.2.1}/impit/src/lib.rs +0 -0
  18. {impit-0.2.0 → impit-0.2.1}/impit/src/request.rs +0 -0
  19. {impit-0.2.0 → impit-0.2.1}/impit/src/response_parsing/mod.rs +0 -0
  20. {impit-0.2.0 → impit-0.2.1}/impit/src/tls/ffdhe.rs +0 -0
  21. {impit-0.2.0 → impit-0.2.1}/impit/src/tls/mod.rs +0 -0
  22. {impit-0.2.0 → impit-0.2.1}/impit/src/tls/statics.rs +0 -0
  23. {impit-0.2.0 → impit-0.2.1}/impit-python/Cargo.toml +0 -0
  24. {impit-0.2.0 → impit-0.2.1}/impit-python/README.md +0 -0
  25. {impit-0.2.0 → impit-0.2.1}/impit-python/clippy.toml +0 -0
  26. {impit-0.2.0 → impit-0.2.1}/impit-python/python/impit/__init__.py +0 -0
  27. {impit-0.2.0 → impit-0.2.1}/impit-python/python/impit/impit.pyi +0 -0
  28. {impit-0.2.0 → impit-0.2.1}/impit-python/python/impit/py.typed +0 -0
  29. {impit-0.2.0 → impit-0.2.1}/impit-python/src/async_client.rs +0 -0
  30. {impit-0.2.0 → impit-0.2.1}/impit-python/src/client.rs +0 -0
  31. {impit-0.2.0 → impit-0.2.1}/impit-python/src/lib.rs +0 -0
  32. {impit-0.2.0 → impit-0.2.1}/impit-python/src/request.rs +0 -0
  33. {impit-0.2.0 → impit-0.2.1}/impit-python/src/response.rs +0 -0
  34. {impit-0.2.0 → impit-0.2.1}/impit-python/test/__init__.py +0 -0
  35. {impit-0.2.0 → impit-0.2.1}/impit-python/test/httpbin.py +0 -0
  36. {impit-0.2.0 → impit-0.2.1}/python/impit/__init__.py +0 -0
  37. {impit-0.2.0 → impit-0.2.1}/python/impit/impit.pyi +0 -0
  38. {impit-0.2.0 → impit-0.2.1}/python/impit/py.typed +0 -0
@@ -116,9 +116,9 @@ dependencies = [
116
116
 
117
117
  [[package]]
118
118
  name = "async-compression"
119
- version = "0.4.22"
119
+ version = "0.4.23"
120
120
  source = "registry+https://github.com/rust-lang/crates.io-index"
121
- checksum = "59a194f9d963d8099596278594b3107448656ba73831c9d8c783e613ce86da64"
121
+ checksum = "b37fc50485c4f3f736a4fb14199f6d5f5ba008d7f28fe710306c92780f004c07"
122
122
  dependencies = [
123
123
  "brotli",
124
124
  "flate2",
@@ -320,9 +320,9 @@ dependencies = [
320
320
 
321
321
  [[package]]
322
322
  name = "aws-lc-sys"
323
- version = "0.28.0"
323
+ version = "0.28.2"
324
324
  source = "registry+https://github.com/rust-lang/crates.io-index"
325
- checksum = "b9f7720b74ed28ca77f90769a71fd8c637a0137f6fae4ae947e1050229cff57f"
325
+ checksum = "bfa9b6986f250236c27e5a204062434a773a13243d2ffc2955f37bdba4c5c6a1"
326
326
  dependencies = [
327
327
  "bindgen",
328
328
  "cc",
@@ -396,9 +396,9 @@ dependencies = [
396
396
 
397
397
  [[package]]
398
398
  name = "brotli"
399
- version = "7.0.0"
399
+ version = "8.0.0"
400
400
  source = "registry+https://github.com/rust-lang/crates.io-index"
401
- checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd"
401
+ checksum = "cf19e729cdbd51af9a397fb9ef8ac8378007b797f8273cfbfdf45dcaa316167b"
402
402
  dependencies = [
403
403
  "alloc-no-stdlib",
404
404
  "alloc-stdlib",
@@ -407,9 +407,9 @@ dependencies = [
407
407
 
408
408
  [[package]]
409
409
  name = "brotli-decompressor"
410
- version = "4.0.2"
410
+ version = "5.0.0"
411
411
  source = "registry+https://github.com/rust-lang/crates.io-index"
412
- checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37"
412
+ checksum = "874bb8112abecc98cbd6d81ea4fa7e94fb9449648c93cc89aa40c81c24d7de03"
413
413
  dependencies = [
414
414
  "alloc-no-stdlib",
415
415
  "alloc-stdlib",
@@ -435,9 +435,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a"
435
435
 
436
436
  [[package]]
437
437
  name = "cc"
438
- version = "1.2.17"
438
+ version = "1.2.19"
439
439
  source = "registry+https://github.com/rust-lang/crates.io-index"
440
- checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a"
440
+ checksum = "8e3a13707ac958681c13b39b458c073d0d9bc8a22cb1b2f4c8e55eb72c13f362"
441
441
  dependencies = [
442
442
  "jobserver",
443
443
  "libc",
@@ -478,9 +478,9 @@ dependencies = [
478
478
 
479
479
  [[package]]
480
480
  name = "clap"
481
- version = "4.5.35"
481
+ version = "4.5.37"
482
482
  source = "registry+https://github.com/rust-lang/crates.io-index"
483
- checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944"
483
+ checksum = "eccb054f56cbd38340b380d4a8e69ef1f02f1af43db2f0cc817a4774d80ae071"
484
484
  dependencies = [
485
485
  "clap_builder",
486
486
  "clap_derive",
@@ -488,9 +488,9 @@ dependencies = [
488
488
 
489
489
  [[package]]
490
490
  name = "clap_builder"
491
- version = "4.5.35"
491
+ version = "4.5.37"
492
492
  source = "registry+https://github.com/rust-lang/crates.io-index"
493
- checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9"
493
+ checksum = "efd9466fac8543255d3b1fcad4762c5e116ffe808c8a3043d4263cd4fd4862a2"
494
494
  dependencies = [
495
495
  "anstream",
496
496
  "anstyle",
@@ -640,9 +640,9 @@ dependencies = [
640
640
 
641
641
  [[package]]
642
642
  name = "ctor"
643
- version = "0.4.1"
643
+ version = "0.4.2"
644
644
  source = "registry+https://github.com/rust-lang/crates.io-index"
645
- checksum = "07e9666f4a9a948d4f1dff0c08a4512b0f7c86414b23960104c243c10d79f4c3"
645
+ checksum = "a4735f265ba6a1188052ca32d461028a7d1125868be18e287e756019da7607b5"
646
646
  dependencies = [
647
647
  "ctor-proc-macro",
648
648
  "dtor",
@@ -656,24 +656,24 @@ checksum = "4f211af61d8efdd104f96e57adf5e426ba1bc3ed7a4ead616e15e5881fd79c4d"
656
656
 
657
657
  [[package]]
658
658
  name = "data-encoding"
659
- version = "2.8.0"
659
+ version = "2.9.0"
660
660
  source = "registry+https://github.com/rust-lang/crates.io-index"
661
- checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010"
661
+ checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476"
662
662
 
663
663
  [[package]]
664
664
  name = "deranged"
665
- version = "0.4.1"
665
+ version = "0.4.0"
666
666
  source = "registry+https://github.com/rust-lang/crates.io-index"
667
- checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058"
667
+ checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e"
668
668
  dependencies = [
669
669
  "powerfmt",
670
670
  ]
671
671
 
672
672
  [[package]]
673
673
  name = "derive_more"
674
- version = "0.99.19"
674
+ version = "0.99.20"
675
675
  source = "registry+https://github.com/rust-lang/crates.io-index"
676
- checksum = "3da29a38df43d6f156149c9b43ded5e018ddff2a855cf2cfd62e8cd7d079c69f"
676
+ checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f"
677
677
  dependencies = [
678
678
  "proc-macro2",
679
679
  "quote",
@@ -717,9 +717,9 @@ dependencies = [
717
717
 
718
718
  [[package]]
719
719
  name = "dtor"
720
- version = "0.0.5"
720
+ version = "0.0.6"
721
721
  source = "registry+https://github.com/rust-lang/crates.io-index"
722
- checksum = "222ef136a1c687d4aa0395c175f2c4586e379924c352fd02f7870cf7de783c23"
722
+ checksum = "97cbdf2ad6846025e8e25df05171abfb30e3ababa12ee0a0e44b9bbe570633a8"
723
723
  dependencies = [
724
724
  "dtor-proc-macro",
725
725
  ]
@@ -847,9 +847,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
847
847
 
848
848
  [[package]]
849
849
  name = "errno"
850
- version = "0.3.10"
850
+ version = "0.3.11"
851
851
  source = "registry+https://github.com/rust-lang/crates.io-index"
852
- checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
852
+ checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e"
853
853
  dependencies = [
854
854
  "libc",
855
855
  "windows-sys 0.59.0",
@@ -1066,9 +1066,9 @@ dependencies = [
1066
1066
 
1067
1067
  [[package]]
1068
1068
  name = "getrandom"
1069
- version = "0.2.15"
1069
+ version = "0.2.16"
1070
1070
  source = "registry+https://github.com/rust-lang/crates.io-index"
1071
- checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
1071
+ checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
1072
1072
  dependencies = [
1073
1073
  "cfg-if",
1074
1074
  "js-sys",
@@ -1192,7 +1192,7 @@ dependencies = [
1192
1192
  "hickory-proto",
1193
1193
  "once_cell",
1194
1194
  "radix_trie",
1195
- "rand 0.9.0",
1195
+ "rand 0.9.1",
1196
1196
  "thiserror",
1197
1197
  "tokio",
1198
1198
  "tracing",
@@ -1216,7 +1216,7 @@ dependencies = [
1216
1216
  "idna",
1217
1217
  "ipnet",
1218
1218
  "once_cell",
1219
- "rand 0.9.0",
1219
+ "rand 0.9.1",
1220
1220
  "ring",
1221
1221
  "thiserror",
1222
1222
  "tinyvec",
@@ -1567,9 +1567,9 @@ dependencies = [
1567
1567
 
1568
1568
  [[package]]
1569
1569
  name = "indexmap"
1570
- version = "2.8.0"
1570
+ version = "2.9.0"
1571
1571
  source = "registry+https://github.com/rust-lang/crates.io-index"
1572
- checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058"
1572
+ checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
1573
1573
  dependencies = [
1574
1574
  "equivalent",
1575
1575
  "hashbrown",
@@ -1651,9 +1651,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
1651
1651
 
1652
1652
  [[package]]
1653
1653
  name = "libc"
1654
- version = "0.2.171"
1654
+ version = "0.2.172"
1655
1655
  source = "registry+https://github.com/rust-lang/crates.io-index"
1656
- checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6"
1656
+ checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
1657
1657
 
1658
1658
  [[package]]
1659
1659
  name = "libloading"
@@ -1673,9 +1673,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab"
1673
1673
 
1674
1674
  [[package]]
1675
1675
  name = "linux-raw-sys"
1676
- version = "0.9.3"
1676
+ version = "0.9.4"
1677
1677
  source = "registry+https://github.com/rust-lang/crates.io-index"
1678
- checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413"
1678
+ checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12"
1679
1679
 
1680
1680
  [[package]]
1681
1681
  name = "litemap"
@@ -1768,9 +1768,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
1768
1768
 
1769
1769
  [[package]]
1770
1770
  name = "miniz_oxide"
1771
- version = "0.8.7"
1771
+ version = "0.8.8"
1772
1772
  source = "registry+https://github.com/rust-lang/crates.io-index"
1773
- checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430"
1773
+ checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a"
1774
1774
  dependencies = [
1775
1775
  "adler2",
1776
1776
  ]
@@ -1971,9 +1971,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
1971
1971
 
1972
1972
  [[package]]
1973
1973
  name = "openssl-src"
1974
- version = "300.4.2+3.4.1"
1974
+ version = "300.5.0+3.5.0"
1975
1975
  source = "registry+https://github.com/rust-lang/crates.io-index"
1976
- checksum = "168ce4e058f975fe43e89d9ccf78ca668601887ae736090aacc23ae353c298e2"
1976
+ checksum = "e8ce546f549326b0e6052b649198487d91320875da901e7bd11a06d1ee3f9c2f"
1977
1977
  dependencies = [
1978
1978
  "cc",
1979
1979
  ]
@@ -2151,9 +2151,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
2151
2151
 
2152
2152
  [[package]]
2153
2153
  name = "prettyplease"
2154
- version = "0.2.31"
2154
+ version = "0.2.32"
2155
2155
  source = "registry+https://github.com/rust-lang/crates.io-index"
2156
- checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb"
2156
+ checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6"
2157
2157
  dependencies = [
2158
2158
  "proc-macro2",
2159
2159
  "syn",
@@ -2161,9 +2161,9 @@ dependencies = [
2161
2161
 
2162
2162
  [[package]]
2163
2163
  name = "proc-macro2"
2164
- version = "1.0.94"
2164
+ version = "1.0.95"
2165
2165
  source = "registry+https://github.com/rust-lang/crates.io-index"
2166
- checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84"
2166
+ checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
2167
2167
  dependencies = [
2168
2168
  "unicode-ident",
2169
2169
  ]
@@ -2186,9 +2186,9 @@ dependencies = [
2186
2186
 
2187
2187
  [[package]]
2188
2188
  name = "pyo3"
2189
- version = "0.24.1"
2189
+ version = "0.24.2"
2190
2190
  source = "registry+https://github.com/rust-lang/crates.io-index"
2191
- checksum = "17da310086b068fbdcefbba30aeb3721d5bb9af8db4987d6735b2183ca567229"
2191
+ checksum = "e5203598f366b11a02b13aa20cab591229ff0a89fd121a308a5df751d5fc9219"
2192
2192
  dependencies = [
2193
2193
  "cfg-if",
2194
2194
  "indoc",
@@ -2230,9 +2230,9 @@ dependencies = [
2230
2230
 
2231
2231
  [[package]]
2232
2232
  name = "pyo3-build-config"
2233
- version = "0.24.1"
2233
+ version = "0.24.2"
2234
2234
  source = "registry+https://github.com/rust-lang/crates.io-index"
2235
- checksum = "e27165889bd793000a098bb966adc4300c312497ea25cf7a690a9f0ac5aa5fc1"
2235
+ checksum = "99636d423fa2ca130fa5acde3059308006d46f98caac629418e53f7ebb1e9999"
2236
2236
  dependencies = [
2237
2237
  "once_cell",
2238
2238
  "target-lexicon",
@@ -2240,9 +2240,9 @@ dependencies = [
2240
2240
 
2241
2241
  [[package]]
2242
2242
  name = "pyo3-ffi"
2243
- version = "0.24.1"
2243
+ version = "0.24.2"
2244
2244
  source = "registry+https://github.com/rust-lang/crates.io-index"
2245
- checksum = "05280526e1dbf6b420062f3ef228b78c0c54ba94e157f5cb724a609d0f2faabc"
2245
+ checksum = "78f9cf92ba9c409279bc3305b5409d90db2d2c22392d443a87df3a1adad59e33"
2246
2246
  dependencies = [
2247
2247
  "libc",
2248
2248
  "pyo3-build-config",
@@ -2250,9 +2250,9 @@ dependencies = [
2250
2250
 
2251
2251
  [[package]]
2252
2252
  name = "pyo3-macros"
2253
- version = "0.24.1"
2253
+ version = "0.24.2"
2254
2254
  source = "registry+https://github.com/rust-lang/crates.io-index"
2255
- checksum = "5c3ce5686aa4d3f63359a5100c62a127c9f15e8398e5fdeb5deef1fed5cd5f44"
2255
+ checksum = "0b999cb1a6ce21f9a6b147dcf1be9ffedf02e0043aec74dc390f3007047cecd9"
2256
2256
  dependencies = [
2257
2257
  "proc-macro2",
2258
2258
  "pyo3-macros-backend",
@@ -2262,9 +2262,9 @@ dependencies = [
2262
2262
 
2263
2263
  [[package]]
2264
2264
  name = "pyo3-macros-backend"
2265
- version = "0.24.1"
2265
+ version = "0.24.2"
2266
2266
  source = "registry+https://github.com/rust-lang/crates.io-index"
2267
- checksum = "f4cf6faa0cbfb0ed08e89beb8103ae9724eb4750e3a78084ba4017cbe94f3855"
2267
+ checksum = "822ece1c7e1012745607d5cf0bcb2874769f0f7cb34c4cde03b9358eb9ef911a"
2268
2268
  dependencies = [
2269
2269
  "heck",
2270
2270
  "proc-macro2",
@@ -2296,13 +2296,13 @@ dependencies = [
2296
2296
 
2297
2297
  [[package]]
2298
2298
  name = "quinn-proto"
2299
- version = "0.11.10"
2299
+ version = "0.11.11"
2300
2300
  source = "registry+https://github.com/rust-lang/crates.io-index"
2301
- checksum = "b820744eb4dc9b57a3398183639c511b5a26d2ed702cedd3febaa1393caa22cc"
2301
+ checksum = "bcbafbbdbb0f638fe3f35f3c56739f77a8a1d070cb25603226c83339b391472b"
2302
2302
  dependencies = [
2303
2303
  "bytes",
2304
2304
  "getrandom 0.3.2",
2305
- "rand 0.9.0",
2305
+ "rand 0.9.1",
2306
2306
  "ring",
2307
2307
  "rustc-hash 2.1.1",
2308
2308
  "rustls",
@@ -2364,13 +2364,12 @@ dependencies = [
2364
2364
 
2365
2365
  [[package]]
2366
2366
  name = "rand"
2367
- version = "0.9.0"
2367
+ version = "0.9.1"
2368
2368
  source = "registry+https://github.com/rust-lang/crates.io-index"
2369
- checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94"
2369
+ checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97"
2370
2370
  dependencies = [
2371
2371
  "rand_chacha",
2372
2372
  "rand_core 0.9.3",
2373
- "zerocopy",
2374
2373
  ]
2375
2374
 
2376
2375
  [[package]]
@@ -2400,9 +2399,9 @@ dependencies = [
2400
2399
 
2401
2400
  [[package]]
2402
2401
  name = "redox_syscall"
2403
- version = "0.5.10"
2402
+ version = "0.5.11"
2404
2403
  source = "registry+https://github.com/rust-lang/crates.io-index"
2405
- checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1"
2404
+ checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3"
2406
2405
  dependencies = [
2407
2406
  "bitflags",
2408
2407
  ]
@@ -2502,7 +2501,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7"
2502
2501
  dependencies = [
2503
2502
  "cc",
2504
2503
  "cfg-if",
2505
- "getrandom 0.2.15",
2504
+ "getrandom 0.2.16",
2506
2505
  "libc",
2507
2506
  "untrusted 0.9.0",
2508
2507
  "windows-sys 0.52.0",
@@ -2548,14 +2547,14 @@ dependencies = [
2548
2547
  "bitflags",
2549
2548
  "errno",
2550
2549
  "libc",
2551
- "linux-raw-sys 0.9.3",
2550
+ "linux-raw-sys 0.9.4",
2552
2551
  "windows-sys 0.59.0",
2553
2552
  ]
2554
2553
 
2555
2554
  [[package]]
2556
2555
  name = "rustls"
2557
- version = "0.23.23"
2558
- source = "git+https://github.com/apify/rustls?branch=main#9bc6e441c555000d5a7cd6230c61c8e9c8aab2e1"
2556
+ version = "0.23.26"
2557
+ source = "git+https://github.com/apify/rustls?branch=main#a90f77d960c4a00767bd6d51e67eee028f88d6fc"
2559
2558
  dependencies = [
2560
2559
  "aws-lc-rs",
2561
2560
  "brotli",
@@ -2589,9 +2588,9 @@ dependencies = [
2589
2588
 
2590
2589
  [[package]]
2591
2590
  name = "rustls-webpki"
2592
- version = "0.102.8"
2591
+ version = "0.103.1"
2593
2592
  source = "registry+https://github.com/rust-lang/crates.io-index"
2594
- checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9"
2593
+ checksum = "fef8b8769aaccf73098557a87cd1816b4f9c7c16811c9c77142aa695c16f2c03"
2595
2594
  dependencies = [
2596
2595
  "aws-lc-rs",
2597
2596
  "ring",
@@ -2750,9 +2749,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
2750
2749
 
2751
2750
  [[package]]
2752
2751
  name = "signal-hook-registry"
2753
- version = "1.4.2"
2752
+ version = "1.4.5"
2754
2753
  source = "registry+https://github.com/rust-lang/crates.io-index"
2755
- checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1"
2754
+ checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410"
2756
2755
  dependencies = [
2757
2756
  "libc",
2758
2757
  ]
@@ -2774,9 +2773,9 @@ dependencies = [
2774
2773
 
2775
2774
  [[package]]
2776
2775
  name = "smallvec"
2777
- version = "1.14.0"
2776
+ version = "1.15.0"
2778
2777
  source = "registry+https://github.com/rust-lang/crates.io-index"
2779
- checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd"
2778
+ checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9"
2780
2779
 
2781
2780
  [[package]]
2782
2781
  name = "socket2"
@@ -3051,9 +3050,9 @@ dependencies = [
3051
3050
 
3052
3051
  [[package]]
3053
3052
  name = "tokio-util"
3054
- version = "0.7.14"
3053
+ version = "0.7.15"
3055
3054
  source = "registry+https://github.com/rust-lang/crates.io-index"
3056
- checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034"
3055
+ checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df"
3057
3056
  dependencies = [
3058
3057
  "bytes",
3059
3058
  "futures-core",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: impit
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Classifier: Development Status :: 4 - Beta
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: Apache Software License
@@ -1,6 +1,9 @@
1
1
  use crate::emulation::Browser;
2
2
  use reqwest::header::{HeaderMap, HeaderName, HeaderValue};
3
- use std::{collections::HashMap, str::FromStr};
3
+ use std::{
4
+ collections::{HashMap, HashSet},
5
+ str::FromStr,
6
+ };
4
7
 
5
8
  mod statics;
6
9
 
@@ -22,13 +25,18 @@ impl HttpHeaders {
22
25
 
23
26
  impl From<HttpHeaders> for HeaderMap {
24
27
  fn from(val: HttpHeaders) -> Self {
25
- let mut headers = HeaderMap::new();
26
-
27
- let header_values = match val.context.browser {
28
+ let impersonated_headers = match val.context.browser {
28
29
  Some(Browser::Chrome) => statics::CHROME_HEADERS,
29
30
  Some(Browser::Firefox) => statics::FIREFOX_HEADERS,
30
31
  None => &[],
31
- };
32
+ }
33
+ .to_owned();
34
+
35
+ let custom_headers = val
36
+ .context
37
+ .custom_headers
38
+ .iter()
39
+ .map(|(k, v)| (k.as_str(), v.as_str()));
32
40
 
33
41
  let pseudo_headers_order: &[&str] = match val.context.browser {
34
42
  Some(Browser::Chrome) => statics::CHROME_PSEUDOHEADERS_ORDER.as_ref(),
@@ -43,33 +51,21 @@ impl From<HttpHeaders> for HeaderMap {
43
51
  );
44
52
  }
45
53
 
46
- let mut used_custom_headers: Vec<String> = vec![];
54
+ let mut headers = HeaderMap::new();
47
55
 
48
- // TODO: don't use HTTP2 headers for HTTP1.1
49
- for (name, impersonated_value) in header_values {
50
- let value: &str = match val.context.custom_headers.get(*name) {
51
- Some(custom_value) => {
52
- used_custom_headers.push(name.to_string());
53
- custom_value.as_str()
54
- }
55
- None => impersonated_value,
56
- };
56
+ let mut used_header_names: HashSet<String> = HashSet::new();
57
+
58
+ for (name, value) in custom_headers.chain(impersonated_headers) {
59
+ if used_header_names.contains(&name.to_lowercase()) {
60
+ continue;
61
+ }
57
62
 
58
63
  headers.append(
59
64
  HeaderName::from_str(name).unwrap(),
60
65
  HeaderValue::from_str(value).unwrap(),
61
66
  );
67
+ used_header_names.insert(name.to_lowercase());
62
68
  }
63
-
64
- val.context.custom_headers.iter().for_each(|(name, value)| {
65
- if !used_custom_headers.contains(name) {
66
- headers.append(
67
- HeaderName::from_str(name).unwrap(),
68
- HeaderValue::from_str(value).unwrap(),
69
- );
70
- }
71
- });
72
-
73
69
  headers
74
70
  }
75
71
  }
@@ -86,6 +86,7 @@ pub struct ImpitBuilder {
86
86
  request_timeout: Duration,
87
87
  max_http_version: Version,
88
88
  redirect: RedirectBehavior,
89
+ store_cookies: bool,
89
90
  }
90
91
 
91
92
  impl Default for ImpitBuilder {
@@ -98,6 +99,7 @@ impl Default for ImpitBuilder {
98
99
  request_timeout: Duration::from_secs(30),
99
100
  max_http_version: Version::HTTP_2,
100
101
  redirect: RedirectBehavior::FollowRedirect(10),
102
+ store_cookies: true,
101
103
  }
102
104
  }
103
105
  }
@@ -165,6 +167,16 @@ impl ImpitBuilder {
165
167
  self
166
168
  }
167
169
 
170
+ /// Sets whether to store cookies in the internal Client cookie store.
171
+ ///
172
+ /// If set to `true`, the client will store cookies in the internal cookie store.
173
+ /// If set to `false`, the client will not store cookies. Response headers will contain the
174
+ /// `Set-Cookie` header.
175
+ pub fn with_store_cookies(mut self, store_cookies: bool) -> Self {
176
+ self.store_cookies = store_cookies;
177
+ self
178
+ }
179
+
168
180
  /// Builds the [`Impit`] instance.
169
181
  pub fn build(self) -> Impit {
170
182
  Impit::new(self)
@@ -193,7 +205,7 @@ impl Impit {
193
205
  .danger_accept_invalid_certs(config.ignore_tls_errors)
194
206
  .danger_accept_invalid_hostnames(config.ignore_tls_errors)
195
207
  .use_preconfigured_tls(tls_config)
196
- .cookie_store(true)
208
+ .cookie_store(config.store_cookies)
197
209
  .timeout(config.request_timeout);
198
210
 
199
211
  if config.max_http_version == Version::HTTP_3 {
@@ -27,6 +27,14 @@ class TestBasicRequests:
27
27
  resp = await impit.get(f'{protocol}example.org')
28
28
  assert resp.status_code == 200
29
29
 
30
+ @pytest.mark.asyncio
31
+ async def test_boringssl_based_server(self, browser: Browser) -> None:
32
+ impit = AsyncClient(browser=browser)
33
+
34
+ response = await impit.get('https://www.google.com')
35
+ assert response.status_code == 200
36
+ assert response.text
37
+
30
38
  @pytest.mark.asyncio
31
39
  async def test_headers_work(self, browser: Browser) -> None:
32
40
  impit = AsyncClient(browser=browser)
@@ -37,6 +45,15 @@ class TestBasicRequests:
37
45
  assert response.status_code == 200
38
46
  assert json.loads(response.text)['headers']['Impit-Test'] == 'foo'
39
47
 
48
+ @pytest.mark.asyncio
49
+ async def test_overwriting_headers_work(self, browser: Browser) -> None:
50
+ impit = AsyncClient(browser=browser)
51
+
52
+ response = await impit.get(get_httpbin_url('/headers'), headers={'User-Agent': 'this is impit!'})
53
+ assert response.status_code == 200
54
+ assert json.loads(response.text)['headers']['User-Agent'] == 'this is impit!'
55
+
56
+ @pytest.mark.skip(reason='Flaky under the CI environment')
40
57
  @pytest.mark.asyncio
41
58
  async def test_http3_works(self, browser: Browser) -> None:
42
59
  impit = AsyncClient(browser=browser, http3=True)
@@ -26,6 +26,13 @@ class TestBasicRequests:
26
26
  resp = impit.get(f'{protocol}example.org')
27
27
  assert resp.status_code == 200
28
28
 
29
+ def test_boringssl_based_server(self, browser: Browser) -> None:
30
+ impit = Client(browser=browser)
31
+
32
+ response = impit.get('https://www.google.com')
33
+ assert response.status_code == 200
34
+ assert response.text
35
+
29
36
  def test_content_encoding(self, browser: Browser) -> None:
30
37
  impit = Client(browser=browser)
31
38
 
@@ -42,6 +49,14 @@ class TestBasicRequests:
42
49
  assert response.status_code == 200
43
50
  assert json.loads(response.text)['headers']['Impit-Test'] == 'foo'
44
51
 
52
+ def test_overwriting_headers_work(self, browser: Browser) -> None:
53
+ impit = Client(browser=browser)
54
+
55
+ response = impit.get(get_httpbin_url('/headers'), headers={'User-Agent': 'this is impit!'})
56
+ assert response.status_code == 200
57
+ assert json.loads(response.text)['headers']['User-Agent'] == 'this is impit!'
58
+
59
+ @pytest.mark.skip(reason='Flaky under the CI environment')
45
60
  def test_http3_works(self, browser: Browser) -> None:
46
61
  impit = Client(browser=browser, http3=True)
47
62