primp 1.2.0__tar.gz → 1.2.2__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 (64) hide show
  1. {primp-1.2.0 → primp-1.2.2}/Cargo.lock +77 -79
  2. {primp-1.2.0 → primp-1.2.2}/Cargo.toml +1 -1
  3. {primp-1.2.0 → primp-1.2.2}/PKG-INFO +1 -1
  4. {primp-1.2.0 → primp-1.2.2}/crates/primp/Cargo.toml +1 -2
  5. {primp-1.2.0 → primp-1.2.2}/crates/primp/src/lib.rs +34 -28
  6. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/Cargo.toml +1 -1
  7. primp-1.2.2/crates/primp-python/benchmark/benchmark.jpg +0 -0
  8. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/benchmark/benchmark.py +30 -19
  9. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/benchmark/run.py +34 -27
  10. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/benchmark/server.py +19 -15
  11. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/docs/async_client.md +4 -0
  12. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/docs/client.md +9 -4
  13. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/docs/response.md +4 -16
  14. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/async_usage.py +1 -0
  15. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/authentication.py +2 -8
  16. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/basic_usage.py +20 -4
  17. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/cookies.py +9 -8
  18. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/error_handling.py +7 -0
  19. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/post_requests.py +6 -8
  20. primp-1.2.2/crates/primp-python/primp.pyi +831 -0
  21. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/async/client.rs +117 -23
  22. primp-1.2.2/crates/primp-python/src/async/mod.rs +5 -0
  23. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/async/response.rs +82 -125
  24. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/client_builder.rs +12 -0
  25. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/lib.rs +236 -54
  26. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/response.rs +113 -194
  27. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/server.py +42 -11
  28. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_client.py +279 -3
  29. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_exceptions.py +26 -0
  30. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_http_methods.py +132 -0
  31. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_request_params.py +171 -0
  32. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_response.py +21 -0
  33. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_streaming.py +312 -0
  34. primp-1.2.0/crates/primp-python/benchmark/benchmark.jpg +0 -0
  35. primp-1.2.0/crates/primp-python/primp.pyi +0 -1031
  36. primp-1.2.0/crates/primp-python/src/async/mod.rs +0 -7
  37. {primp-1.2.0 → primp-1.2.2}/README.md +0 -0
  38. {primp-1.2.0 → primp-1.2.2}/crates/primp/LICENSE-MIT +0 -0
  39. {primp-1.2.0 → primp-1.2.2}/crates/primp/README.md +0 -0
  40. {primp-1.2.0 → primp-1.2.2}/crates/primp/src/imp/chrome/mod.rs +0 -0
  41. {primp-1.2.0 → primp-1.2.2}/crates/primp/src/imp/edge/mod.rs +0 -0
  42. {primp-1.2.0 → primp-1.2.2}/crates/primp/src/imp/firefox/mod.rs +0 -0
  43. {primp-1.2.0 → primp-1.2.2}/crates/primp/src/imp/mod.rs +0 -0
  44. {primp-1.2.0 → primp-1.2.2}/crates/primp/src/imp/opera/mod.rs +0 -0
  45. {primp-1.2.0 → primp-1.2.2}/crates/primp/src/imp/safari/mod.rs +0 -0
  46. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/.gitignore +0 -0
  47. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/README.md +0 -0
  48. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/benchmark/README.md +0 -0
  49. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/benchmark/requirements.txt +0 -0
  50. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/docs/exceptions.md +0 -0
  51. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/docs/impersonate.md +0 -0
  52. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/html_conversion.py +0 -0
  53. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/proxy.py +0 -0
  54. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/examples/streaming.py +1 -1
  55. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/py.typed +0 -0
  56. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/error.rs +0 -0
  57. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/impersonate.rs +0 -0
  58. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/traits.rs +0 -0
  59. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/src/utils.rs +0 -0
  60. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/__init__.py +0 -0
  61. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/conftest.py +0 -0
  62. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_header_order.py +0 -0
  63. {primp-1.2.0 → primp-1.2.2}/crates/primp-python/tests/test_impersonate.py +0 -0
  64. {primp-1.2.0 → primp-1.2.2}/pyproject.toml +0 -0
@@ -152,9 +152,9 @@ dependencies = [
152
152
 
153
153
  [[package]]
154
154
  name = "aws-lc-sys"
155
- version = "0.39.0"
155
+ version = "0.39.1"
156
156
  source = "registry+https://github.com/rust-lang/crates.io-index"
157
- checksum = "1fa7e52a4c5c547c741610a2c6f123f3881e409b714cd27e6798ef020c514f0a"
157
+ checksum = "83a25cf98105baa966497416dbd42565ce3a8cf8dbfd59803ec9ad46f3126399"
158
158
  dependencies = [
159
159
  "cc",
160
160
  "cmake",
@@ -221,9 +221,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
221
221
 
222
222
  [[package]]
223
223
  name = "cc"
224
- version = "1.2.57"
224
+ version = "1.2.58"
225
225
  source = "registry+https://github.com/rust-lang/crates.io-index"
226
- checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423"
226
+ checksum = "e1e928d4b69e3077709075a938a05ffbedfa53a84c8f766efbf8220bb1ff60e1"
227
227
  dependencies = [
228
228
  "find-msvc-tools",
229
229
  "jobserver",
@@ -1229,9 +1229,9 @@ dependencies = [
1229
1229
 
1230
1230
  [[package]]
1231
1231
  name = "indexmap"
1232
- version = "2.13.0"
1232
+ version = "2.13.1"
1233
1233
  source = "registry+https://github.com/rust-lang/crates.io-index"
1234
- checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017"
1234
+ checksum = "45a8a2b9cb3e0b0c1803dbb0758ffac5de2f425b23c28f518faabd9d805342ff"
1235
1235
  dependencies = [
1236
1236
  "equivalent",
1237
1237
  "hashbrown 0.16.1",
@@ -1241,9 +1241,9 @@ dependencies = [
1241
1241
 
1242
1242
  [[package]]
1243
1243
  name = "inventory"
1244
- version = "0.3.22"
1244
+ version = "0.3.24"
1245
1245
  source = "registry+https://github.com/rust-lang/crates.io-index"
1246
- checksum = "009ae045c87e7082cb72dab0ccd01ae075dd00141ddc108f43a0ea150a9e7227"
1246
+ checksum = "a4f0c30c76f2f4ccee3fe55a2435f691ca00c0e4bd87abe4f4a851b1d4dac39b"
1247
1247
  dependencies = [
1248
1248
  "rustversion",
1249
1249
  ]
@@ -1278,9 +1278,9 @@ dependencies = [
1278
1278
 
1279
1279
  [[package]]
1280
1280
  name = "iri-string"
1281
- version = "0.7.11"
1281
+ version = "0.7.12"
1282
1282
  source = "registry+https://github.com/rust-lang/crates.io-index"
1283
- checksum = "d8e7418f59cc01c88316161279a7f665217ae316b388e58a0d10e29f54f1e5eb"
1283
+ checksum = "25e659a4bb38e810ebc252e53b5814ff908a8c58c2a9ce2fae1bbec24cbf4e20"
1284
1284
  dependencies = [
1285
1285
  "memchr",
1286
1286
  "serde",
@@ -1324,10 +1324,12 @@ dependencies = [
1324
1324
 
1325
1325
  [[package]]
1326
1326
  name = "js-sys"
1327
- version = "0.3.91"
1327
+ version = "0.3.94"
1328
1328
  source = "registry+https://github.com/rust-lang/crates.io-index"
1329
- checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c"
1329
+ checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9"
1330
1330
  dependencies = [
1331
+ "cfg-if",
1332
+ "futures-util",
1331
1333
  "once_cell",
1332
1334
  "wasm-bindgen",
1333
1335
  ]
@@ -1346,9 +1348,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
1346
1348
 
1347
1349
  [[package]]
1348
1350
  name = "libc"
1349
- version = "0.2.183"
1351
+ version = "0.2.184"
1350
1352
  source = "registry+https://github.com/rust-lang/crates.io-index"
1351
- checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d"
1353
+ checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af"
1352
1354
 
1353
1355
  [[package]]
1354
1356
  name = "libm"
@@ -1364,9 +1366,9 @@ checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53"
1364
1366
 
1365
1367
  [[package]]
1366
1368
  name = "litemap"
1367
- version = "0.8.1"
1369
+ version = "0.8.2"
1368
1370
  source = "registry+https://github.com/rust-lang/crates.io-index"
1369
- checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77"
1371
+ checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0"
1370
1372
 
1371
1373
  [[package]]
1372
1374
  name = "litrs"
@@ -1472,9 +1474,9 @@ dependencies = [
1472
1474
 
1473
1475
  [[package]]
1474
1476
  name = "mio"
1475
- version = "1.1.1"
1477
+ version = "1.2.0"
1476
1478
  source = "registry+https://github.com/rust-lang/crates.io-index"
1477
- checksum = "a69bcab0ad47271a0234d9422b131806bf3968021e5dc9328caf2d4cd58557fc"
1479
+ checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1"
1478
1480
  dependencies = [
1479
1481
  "libc",
1480
1482
  "wasi",
@@ -1860,9 +1862,9 @@ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49"
1860
1862
 
1861
1863
  [[package]]
1862
1864
  name = "potential_utf"
1863
- version = "0.1.4"
1865
+ version = "0.1.5"
1864
1866
  source = "registry+https://github.com/rust-lang/crates.io-index"
1865
- checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77"
1867
+ checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564"
1866
1868
  dependencies = [
1867
1869
  "zerovec",
1868
1870
  ]
@@ -1910,7 +1912,7 @@ dependencies = [
1910
1912
 
1911
1913
  [[package]]
1912
1914
  name = "primp"
1913
- version = "1.2.0"
1915
+ version = "1.2.2"
1914
1916
  dependencies = [
1915
1917
  "criterion",
1916
1918
  "h2",
@@ -1922,12 +1924,11 @@ dependencies = [
1922
1924
  "serde_json",
1923
1925
  "tokio",
1924
1926
  "url",
1925
- "webpki-roots",
1926
1927
  ]
1927
1928
 
1928
1929
  [[package]]
1929
1930
  name = "primp-python"
1930
- version = "1.2.0"
1931
+ version = "1.2.2"
1931
1932
  dependencies = [
1932
1933
  "anyhow",
1933
1934
  "bytes",
@@ -1981,9 +1982,9 @@ dependencies = [
1981
1982
 
1982
1983
  [[package]]
1983
1984
  name = "pyo3"
1984
- version = "0.28.2"
1985
+ version = "0.28.3"
1985
1986
  source = "registry+https://github.com/rust-lang/crates.io-index"
1986
- checksum = "cf85e27e86080aafd5a22eae58a162e133a589551542b3e5cee4beb27e54f8e1"
1987
+ checksum = "91fd8e38a3b50ed1167fb981cd6fd60147e091784c427b8f7183a7ee32c31c12"
1987
1988
  dependencies = [
1988
1989
  "anyhow",
1989
1990
  "indexmap",
@@ -2012,18 +2013,18 @@ dependencies = [
2012
2013
 
2013
2014
  [[package]]
2014
2015
  name = "pyo3-build-config"
2015
- version = "0.28.2"
2016
+ version = "0.28.3"
2016
2017
  source = "registry+https://github.com/rust-lang/crates.io-index"
2017
- checksum = "8bf94ee265674bf76c09fa430b0e99c26e319c945d96ca0d5a8215f31bf81cf7"
2018
+ checksum = "e368e7ddfdeb98c9bca7f8383be1648fd84ab466bf2bc015e94008db6d35611e"
2018
2019
  dependencies = [
2019
2020
  "target-lexicon",
2020
2021
  ]
2021
2022
 
2022
2023
  [[package]]
2023
2024
  name = "pyo3-ffi"
2024
- version = "0.28.2"
2025
+ version = "0.28.3"
2025
2026
  source = "registry+https://github.com/rust-lang/crates.io-index"
2026
- checksum = "491aa5fc66d8059dd44a75f4580a2962c1862a1c2945359db36f6c2818b748dc"
2027
+ checksum = "7f29e10af80b1f7ccaf7f69eace800a03ecd13e883acfacc1e5d0988605f651e"
2027
2028
  dependencies = [
2028
2029
  "libc",
2029
2030
  "pyo3-build-config",
@@ -2042,9 +2043,9 @@ dependencies = [
2042
2043
 
2043
2044
  [[package]]
2044
2045
  name = "pyo3-macros"
2045
- version = "0.28.2"
2046
+ version = "0.28.3"
2046
2047
  source = "registry+https://github.com/rust-lang/crates.io-index"
2047
- checksum = "f5d671734e9d7a43449f8480f8b38115df67bef8d21f76837fa75ee7aaa5e52e"
2048
+ checksum = "df6e520eff47c45997d2fc7dd8214b25dd1310918bbb2642156ef66a67f29813"
2048
2049
  dependencies = [
2049
2050
  "proc-macro2",
2050
2051
  "pyo3-macros-backend",
@@ -2054,9 +2055,9 @@ dependencies = [
2054
2055
 
2055
2056
  [[package]]
2056
2057
  name = "pyo3-macros-backend"
2057
- version = "0.28.2"
2058
+ version = "0.28.3"
2058
2059
  source = "registry+https://github.com/rust-lang/crates.io-index"
2059
- checksum = "22faaa1ce6c430a1f71658760497291065e6450d7b5dc2bcf254d49f66ee700a"
2060
+ checksum = "c4cdc218d835738f81c2338f822078af45b4afdf8b2e33cbb5916f108b813acb"
2060
2061
  dependencies = [
2061
2062
  "heck",
2062
2063
  "proc-macro2",
@@ -2348,6 +2349,7 @@ dependencies = [
2348
2349
  "pin-project-lite",
2349
2350
  "quinn",
2350
2351
  "rustls",
2352
+ "rustls-native-certs",
2351
2353
  "rustls-pki-types",
2352
2354
  "serde",
2353
2355
  "serde_json",
@@ -2392,9 +2394,9 @@ dependencies = [
2392
2394
 
2393
2395
  [[package]]
2394
2396
  name = "rustc-hash"
2395
- version = "2.1.1"
2397
+ version = "2.1.2"
2396
2398
  source = "registry+https://github.com/rust-lang/crates.io-index"
2397
- checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
2399
+ checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"
2398
2400
 
2399
2401
  [[package]]
2400
2402
  name = "rusticata-macros"
@@ -2873,9 +2875,9 @@ dependencies = [
2873
2875
 
2874
2876
  [[package]]
2875
2877
  name = "tinystr"
2876
- version = "0.8.2"
2878
+ version = "0.8.3"
2877
2879
  source = "registry+https://github.com/rust-lang/crates.io-index"
2878
- checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869"
2880
+ checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d"
2879
2881
  dependencies = [
2880
2882
  "displaydoc",
2881
2883
  "zerovec",
@@ -3241,9 +3243,9 @@ dependencies = [
3241
3243
 
3242
3244
  [[package]]
3243
3245
  name = "wasm-bindgen"
3244
- version = "0.2.114"
3246
+ version = "0.2.117"
3245
3247
  source = "registry+https://github.com/rust-lang/crates.io-index"
3246
- checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e"
3248
+ checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0"
3247
3249
  dependencies = [
3248
3250
  "cfg-if",
3249
3251
  "once_cell",
@@ -3256,23 +3258,19 @@ dependencies = [
3256
3258
 
3257
3259
  [[package]]
3258
3260
  name = "wasm-bindgen-futures"
3259
- version = "0.4.64"
3261
+ version = "0.4.67"
3260
3262
  source = "registry+https://github.com/rust-lang/crates.io-index"
3261
- checksum = "e9c5522b3a28661442748e09d40924dfb9ca614b21c00d3fd135720e48b67db8"
3263
+ checksum = "03623de6905b7206edd0a75f69f747f134b7f0a2323392d664448bf2d3c5d87e"
3262
3264
  dependencies = [
3263
- "cfg-if",
3264
- "futures-util",
3265
3265
  "js-sys",
3266
- "once_cell",
3267
3266
  "wasm-bindgen",
3268
- "web-sys",
3269
3267
  ]
3270
3268
 
3271
3269
  [[package]]
3272
3270
  name = "wasm-bindgen-macro"
3273
- version = "0.2.114"
3271
+ version = "0.2.117"
3274
3272
  source = "registry+https://github.com/rust-lang/crates.io-index"
3275
- checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6"
3273
+ checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be"
3276
3274
  dependencies = [
3277
3275
  "quote",
3278
3276
  "wasm-bindgen-macro-support",
@@ -3280,9 +3278,9 @@ dependencies = [
3280
3278
 
3281
3279
  [[package]]
3282
3280
  name = "wasm-bindgen-macro-support"
3283
- version = "0.2.114"
3281
+ version = "0.2.117"
3284
3282
  source = "registry+https://github.com/rust-lang/crates.io-index"
3285
- checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3"
3283
+ checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2"
3286
3284
  dependencies = [
3287
3285
  "bumpalo",
3288
3286
  "proc-macro2",
@@ -3293,18 +3291,18 @@ dependencies = [
3293
3291
 
3294
3292
  [[package]]
3295
3293
  name = "wasm-bindgen-shared"
3296
- version = "0.2.114"
3294
+ version = "0.2.117"
3297
3295
  source = "registry+https://github.com/rust-lang/crates.io-index"
3298
- checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16"
3296
+ checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b"
3299
3297
  dependencies = [
3300
3298
  "unicode-ident",
3301
3299
  ]
3302
3300
 
3303
3301
  [[package]]
3304
3302
  name = "wasm-bindgen-test"
3305
- version = "0.3.64"
3303
+ version = "0.3.67"
3306
3304
  source = "registry+https://github.com/rust-lang/crates.io-index"
3307
- checksum = "6311c867385cc7d5602463b31825d454d0837a3aba7cdb5e56d5201792a3f7fe"
3305
+ checksum = "941c102b3f0c15b6d72a53205e09e6646aafcf2991e18412cc331dbac1806bc0"
3308
3306
  dependencies = [
3309
3307
  "async-trait",
3310
3308
  "cast",
@@ -3324,9 +3322,9 @@ dependencies = [
3324
3322
 
3325
3323
  [[package]]
3326
3324
  name = "wasm-bindgen-test-macro"
3327
- version = "0.3.64"
3325
+ version = "0.3.67"
3328
3326
  source = "registry+https://github.com/rust-lang/crates.io-index"
3329
- checksum = "67008cdde4769831958536b0f11b3bdd0380bde882be17fff9c2f34bb4549abd"
3327
+ checksum = "a26bd6570f39bb1440fd8f01b63461faaf2a3f6078a508e4e54efa99363108d2"
3330
3328
  dependencies = [
3331
3329
  "proc-macro2",
3332
3330
  "quote",
@@ -3335,9 +3333,9 @@ dependencies = [
3335
3333
 
3336
3334
  [[package]]
3337
3335
  name = "wasm-bindgen-test-shared"
3338
- version = "0.2.114"
3336
+ version = "0.2.117"
3339
3337
  source = "registry+https://github.com/rust-lang/crates.io-index"
3340
- checksum = "cfe29135b180b72b04c74aa97b2b4a2ef275161eff9a6c7955ea9eaedc7e1d4e"
3338
+ checksum = "1c29582b14d5bf030b02fa232b9b57faf2afc322d2c61964dd80bad02bf76207"
3341
3339
 
3342
3340
  [[package]]
3343
3341
  name = "wasm-encoder"
@@ -3388,9 +3386,9 @@ dependencies = [
3388
3386
 
3389
3387
  [[package]]
3390
3388
  name = "web-sys"
3391
- version = "0.3.91"
3389
+ version = "0.3.94"
3392
3390
  source = "registry+https://github.com/rust-lang/crates.io-index"
3393
- checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9"
3391
+ checksum = "cd70027e39b12f0849461e08ffc50b9cd7688d942c1c8e3c7b22273236b4dd0a"
3394
3392
  dependencies = [
3395
3393
  "js-sys",
3396
3394
  "wasm-bindgen",
@@ -3760,9 +3758,9 @@ dependencies = [
3760
3758
 
3761
3759
  [[package]]
3762
3760
  name = "writeable"
3763
- version = "0.6.2"
3761
+ version = "0.6.3"
3764
3762
  source = "registry+https://github.com/rust-lang/crates.io-index"
3765
- checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9"
3763
+ checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4"
3766
3764
 
3767
3765
  [[package]]
3768
3766
  name = "x509-parser"
@@ -3792,9 +3790,9 @@ dependencies = [
3792
3790
 
3793
3791
  [[package]]
3794
3792
  name = "yoke"
3795
- version = "0.8.1"
3793
+ version = "0.8.2"
3796
3794
  source = "registry+https://github.com/rust-lang/crates.io-index"
3797
- checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954"
3795
+ checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca"
3798
3796
  dependencies = [
3799
3797
  "stable_deref_trait",
3800
3798
  "yoke-derive",
@@ -3803,9 +3801,9 @@ dependencies = [
3803
3801
 
3804
3802
  [[package]]
3805
3803
  name = "yoke-derive"
3806
- version = "0.8.1"
3804
+ version = "0.8.2"
3807
3805
  source = "registry+https://github.com/rust-lang/crates.io-index"
3808
- checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d"
3806
+ checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
3809
3807
  dependencies = [
3810
3808
  "proc-macro2",
3811
3809
  "quote",
@@ -3815,18 +3813,18 @@ dependencies = [
3815
3813
 
3816
3814
  [[package]]
3817
3815
  name = "zerocopy"
3818
- version = "0.8.47"
3816
+ version = "0.8.48"
3819
3817
  source = "registry+https://github.com/rust-lang/crates.io-index"
3820
- checksum = "efbb2a062be311f2ba113ce66f697a4dc589f85e78a4aea276200804cea0ed87"
3818
+ checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9"
3821
3819
  dependencies = [
3822
3820
  "zerocopy-derive",
3823
3821
  ]
3824
3822
 
3825
3823
  [[package]]
3826
3824
  name = "zerocopy-derive"
3827
- version = "0.8.47"
3825
+ version = "0.8.48"
3828
3826
  source = "registry+https://github.com/rust-lang/crates.io-index"
3829
- checksum = "0e8bc7269b54418e7aeeef514aa68f8690b8c0489a06b0136e5f57c4c5ccab89"
3827
+ checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4"
3830
3828
  dependencies = [
3831
3829
  "proc-macro2",
3832
3830
  "quote",
@@ -3835,18 +3833,18 @@ dependencies = [
3835
3833
 
3836
3834
  [[package]]
3837
3835
  name = "zerofrom"
3838
- version = "0.1.6"
3836
+ version = "0.1.7"
3839
3837
  source = "registry+https://github.com/rust-lang/crates.io-index"
3840
- checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5"
3838
+ checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df"
3841
3839
  dependencies = [
3842
3840
  "zerofrom-derive",
3843
3841
  ]
3844
3842
 
3845
3843
  [[package]]
3846
3844
  name = "zerofrom-derive"
3847
- version = "0.1.6"
3845
+ version = "0.1.7"
3848
3846
  source = "registry+https://github.com/rust-lang/crates.io-index"
3849
- checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502"
3847
+ checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
3850
3848
  dependencies = [
3851
3849
  "proc-macro2",
3852
3850
  "quote",
@@ -3876,9 +3874,9 @@ dependencies = [
3876
3874
 
3877
3875
  [[package]]
3878
3876
  name = "zerotrie"
3879
- version = "0.2.3"
3877
+ version = "0.2.4"
3880
3878
  source = "registry+https://github.com/rust-lang/crates.io-index"
3881
- checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851"
3879
+ checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf"
3882
3880
  dependencies = [
3883
3881
  "displaydoc",
3884
3882
  "yoke",
@@ -3887,9 +3885,9 @@ dependencies = [
3887
3885
 
3888
3886
  [[package]]
3889
3887
  name = "zerovec"
3890
- version = "0.11.5"
3888
+ version = "0.11.6"
3891
3889
  source = "registry+https://github.com/rust-lang/crates.io-index"
3892
- checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002"
3890
+ checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239"
3893
3891
  dependencies = [
3894
3892
  "yoke",
3895
3893
  "zerofrom",
@@ -3898,9 +3896,9 @@ dependencies = [
3898
3896
 
3899
3897
  [[package]]
3900
3898
  name = "zerovec-derive"
3901
- version = "0.11.2"
3899
+ version = "0.11.3"
3902
3900
  source = "registry+https://github.com/rust-lang/crates.io-index"
3903
- checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3"
3901
+ checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
3904
3902
  dependencies = [
3905
3903
  "proc-macro2",
3906
3904
  "quote",
@@ -3,7 +3,7 @@ resolver = "3"
3
3
  members = ["crates/primp", "crates/primp-python"]
4
4
 
5
5
  [workspace.package]
6
- version = "1.2.0"
6
+ version = "1.2.2"
7
7
  edition = "2021"
8
8
  rust-version = "1.84"
9
9
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: primp
3
- Version: 1.2.0
3
+ Version: 1.2.2
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: Programming Language :: Python :: 3 :: Only
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "primp"
3
- version = "1.2.0"
3
+ version = "1.2.2"
4
4
  description = "HTTP client with browser impersonation capabilities"
5
5
  keywords = ["http", "request", "client", "impersonate"]
6
6
  categories = ["web-programming::http-client"]
@@ -72,7 +72,6 @@ rand = { version = "0.10", optional = true }
72
72
  [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
73
73
  h2 = { version = "0.4", features = ["unstable"] }
74
74
  rustls = { version = "0.23", default-features = false, features = ["std", "tls12", "impersonate", "zlib"] }
75
- webpki-roots = "1"
76
75
 
77
76
  [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
78
77
  tokio = { version = "1.0", default-features = false, features = ["macros", "rt-multi-thread"] }
@@ -47,6 +47,8 @@ pub struct ClientBuilder {
47
47
  impersonate: Option<Impersonate>,
48
48
  #[cfg(not(target_arch = "wasm32"))]
49
49
  os_type: Option<ImpersonateOS>,
50
+ #[cfg(not(target_arch = "wasm32"))]
51
+ root_certs: Vec<reqwest::Certificate>,
50
52
  }
51
53
 
52
54
  impl Default for ClientBuilder {
@@ -66,6 +68,8 @@ impl ClientBuilder {
66
68
  impersonate: None,
67
69
  #[cfg(not(target_arch = "wasm32"))]
68
70
  os_type: None,
71
+ #[cfg(not(target_arch = "wasm32"))]
72
+ root_certs: Vec::new(),
69
73
  }
70
74
  }
71
75
 
@@ -73,29 +77,13 @@ impl ClientBuilder {
73
77
  pub fn build(self) -> crate::Result<Client> {
74
78
  #[cfg(not(target_arch = "wasm32"))]
75
79
  let inner = match (self.impersonate, self.os_type) {
76
- (Some(impersonate), Some(os_type)) => {
77
- let settings = imp::get_browser_settings(impersonate, Some(os_type));
78
- apply_impersonation(self.inner, settings)?
79
- }
80
- (Some(Impersonate::Random), None) => {
81
- let settings =
82
- imp::get_browser_settings(Impersonate::Random, Some(ImpersonateOS::Random));
83
- apply_impersonation(self.inner, settings)?
84
- }
85
- (Some(impersonate), None) => {
86
- let settings = imp::get_browser_settings(impersonate, Some(ImpersonateOS::Random));
87
- apply_impersonation(self.inner, settings)?
88
- }
89
- (None, Some(ImpersonateOS::Random)) => {
90
- let settings =
91
- imp::get_browser_settings(Impersonate::Random, Some(ImpersonateOS::Random));
92
- apply_impersonation(self.inner, settings)?
93
- }
94
- (None, Some(os_type)) => {
95
- let settings = imp::get_browser_settings(Impersonate::Random, Some(os_type));
96
- apply_impersonation(self.inner, settings)?
97
- }
98
80
  (None, None) => self.inner.build()?,
81
+ _ => {
82
+ let imp = self.impersonate.unwrap_or(Impersonate::Random);
83
+ let os = self.os_type.unwrap_or(ImpersonateOS::Random);
84
+ let settings = imp::get_browser_settings(imp, Some(os));
85
+ apply_impersonation(self.inner, settings, &self.root_certs)?
86
+ }
99
87
  };
100
88
 
101
89
  #[cfg(target_arch = "wasm32")]
@@ -404,6 +392,8 @@ impl ClientBuilder {
404
392
 
405
393
  /// Add custom certificate roots.
406
394
  pub fn add_root_certificate(mut self, cert: reqwest::Certificate) -> Self {
395
+ #[cfg(not(target_arch = "wasm32"))]
396
+ self.root_certs.push(cert.clone());
407
397
  self.inner = self.inner.add_root_certificate(cert);
408
398
  self
409
399
  }
@@ -528,6 +518,14 @@ impl Client {
528
518
  pub fn set_proxies(&mut self, proxies: Vec<reqwest::Proxy>) {
529
519
  self.inner.set_proxies(proxies)
530
520
  }
521
+
522
+ /// Set the redirect policy for the client.
523
+ ///
524
+ /// This allows changing redirect behavior at runtime without rebuilding the client.
525
+ /// Use `Policy::none()` to disable redirects, or `Policy::limited(n)` to set a limit.
526
+ pub fn set_redirect_policy(&mut self, policy: reqwest::redirect::Policy) {
527
+ self.inner.set_redirect_policy(policy);
528
+ }
531
529
  }
532
530
 
533
531
  impl Default for Client {
@@ -545,9 +543,10 @@ pub async fn get<T: IntoUrl>(url: T) -> crate::Result<Response> {
545
543
  fn apply_impersonation(
546
544
  builder: reqwest::ClientBuilder,
547
545
  settings: BrowserSettings,
546
+ custom_certs: &[reqwest::Certificate],
548
547
  ) -> crate::Result<reqwest::Client> {
549
548
  // Build rustls::ClientConfig with impersonation TLS settings
550
- let tls_config = build_impersonate_tls_config(&settings);
549
+ let tls_config = build_impersonate_tls_config(&settings, custom_certs)?;
551
550
 
552
551
  // Apply TLS configuration
553
552
  let builder = builder.use_preconfigured_tls(tls_config);
@@ -574,7 +573,10 @@ fn apply_impersonation(
574
573
  }
575
574
 
576
575
  #[cfg(not(target_arch = "wasm32"))]
577
- fn build_impersonate_tls_config(settings: &BrowserSettings) -> rustls::ClientConfig {
576
+ fn build_impersonate_tls_config(
577
+ settings: &BrowserSettings,
578
+ custom_certs: &[reqwest::Certificate],
579
+ ) -> crate::Result<rustls::ClientConfig> {
578
580
  use rustls::client::EchMode;
579
581
  use std::sync::Arc;
580
582
 
@@ -582,9 +584,13 @@ fn build_impersonate_tls_config(settings: &BrowserSettings) -> rustls::ClientCon
582
584
  .cloned()
583
585
  .unwrap_or_else(|| Arc::new(rustls::crypto::aws_lc_rs::default_provider()));
584
586
 
585
- // Create a root store with webpki roots
586
- let mut root_store = rustls::RootCertStore::empty();
587
- root_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());
587
+ // Use cached root store with both webpki roots and native OS root CAs.
588
+ // If custom certs are provided, merge them in.
589
+ let root_store = if custom_certs.is_empty() {
590
+ reqwest::tls::default_root_store().clone()
591
+ } else {
592
+ reqwest::tls::merged_root_store(custom_certs.to_vec())?
593
+ };
588
594
 
589
595
  // ECH GREASE is only used for Chrome-based browsers and Firefox to match JA4 fingerprint
590
596
  // Safari does NOT use ECH GREASE
@@ -629,7 +635,7 @@ fn build_impersonate_tls_config(settings: &BrowserSettings) -> rustls::ClientCon
629
635
  });
630
636
  }
631
637
 
632
- config
638
+ Ok(config)
633
639
  }
634
640
 
635
641
  #[cfg(not(target_arch = "wasm32"))]
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "primp-python"
3
- version = "1.2.0"
3
+ version = "1.2.2"
4
4
  edition = "2021"
5
5
  rust-version = "1.84"
6
6
  description = "HTTP client that can impersonate web browsers"