wreq 1.2.4 → 1.2.6

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 (112) hide show
  1. checksums.yaml +4 -4
  2. data/Cargo.lock +22 -19
  3. data/Cargo.toml +15 -2
  4. data/crates/wreq-util/.github/FUNDING.yml +15 -0
  5. data/crates/wreq-util/.github/ISSUE_TEMPLATE/bug_report.md +38 -0
  6. data/crates/wreq-util/.github/ISSUE_TEMPLATE/custom.md +10 -0
  7. data/crates/wreq-util/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  8. data/crates/wreq-util/.github/dependabot.yml +22 -0
  9. data/crates/wreq-util/.github/workflows/ci.yml +82 -0
  10. data/crates/wreq-util/.github/workflows/release-plz.yml +52 -0
  11. data/crates/wreq-util/.gitignore +24 -0
  12. data/crates/wreq-util/CHANGELOG.md +74 -0
  13. data/crates/wreq-util/Cargo.toml +94 -0
  14. data/crates/wreq-util/LICENSE +201 -0
  15. data/crates/wreq-util/README.md +62 -0
  16. data/crates/wreq-util/examples/emulate.rs +39 -0
  17. data/crates/wreq-util/examples/tower_delay.rs +191 -0
  18. data/crates/wreq-util/release-plz.toml +2 -0
  19. data/crates/wreq-util/rustfmt.toml +5 -0
  20. data/crates/wreq-util/src/emulate/compress.rs +85 -0
  21. data/crates/wreq-util/src/emulate/macros.rs +372 -0
  22. data/crates/wreq-util/src/emulate/profile/chrome/header.rs +74 -0
  23. data/crates/wreq-util/src/emulate/profile/chrome/http2.rs +65 -0
  24. data/crates/wreq-util/src/emulate/profile/chrome/tls.rs +153 -0
  25. data/crates/wreq-util/src/emulate/profile/chrome.rs +2028 -0
  26. data/crates/wreq-util/src/emulate/profile/firefox/header.rs +37 -0
  27. data/crates/wreq-util/src/emulate/profile/firefox/http2.rs +113 -0
  28. data/crates/wreq-util/src/emulate/profile/firefox/tls.rs +253 -0
  29. data/crates/wreq-util/src/emulate/profile/firefox.rs +518 -0
  30. data/crates/wreq-util/src/emulate/profile/okhttp.rs +241 -0
  31. data/crates/wreq-util/src/emulate/profile/opera/header.rs +29 -0
  32. data/crates/wreq-util/src/emulate/profile/opera/http2.rs +50 -0
  33. data/crates/wreq-util/src/emulate/profile/opera/tls.rs +97 -0
  34. data/crates/wreq-util/src/emulate/profile/opera.rs +299 -0
  35. data/crates/wreq-util/src/emulate/profile/safari/header.rs +59 -0
  36. data/crates/wreq-util/src/emulate/profile/safari/http2.rs +116 -0
  37. data/crates/wreq-util/src/emulate/profile/safari/tls.rs +177 -0
  38. data/crates/wreq-util/src/emulate/profile/safari.rs +222 -0
  39. data/crates/wreq-util/src/emulate/profile.rs +47 -0
  40. data/crates/wreq-util/src/emulate.rs +369 -0
  41. data/crates/wreq-util/src/lib.rs +14 -0
  42. data/crates/wreq-util/src/rand.rs +24 -0
  43. data/crates/wreq-util/src/tower/delay/future.rs +43 -0
  44. data/crates/wreq-util/src/tower/delay/layer.rs +201 -0
  45. data/crates/wreq-util/src/tower/delay/service.rs +190 -0
  46. data/crates/wreq-util/src/tower/delay.rs +98 -0
  47. data/crates/wreq-util/src/tower.rs +7 -0
  48. data/crates/wreq-util/tests/client.rs +153 -0
  49. data/crates/wreq-util/tests/emulate_chrome.rs +270 -0
  50. data/crates/wreq-util/tests/emulate_firefox.rs +92 -0
  51. data/crates/wreq-util/tests/emulate_okhttp.rs +46 -0
  52. data/crates/wreq-util/tests/emulate_opera.rs +113 -0
  53. data/crates/wreq-util/tests/emulate_safari.rs +151 -0
  54. data/crates/wreq-util/tests/support/mod.rs +55 -0
  55. data/crates/wreq-util/tests/support/server.rs +232 -0
  56. data/examples/emulate_request.rb +1 -1
  57. data/lib/wreq.rb +72 -45
  58. data/lib/wreq_ruby/body.rb +30 -9
  59. data/lib/wreq_ruby/client.rb +88 -55
  60. data/lib/wreq_ruby/cookie.rb +81 -21
  61. data/lib/wreq_ruby/emulate.rb +77 -7
  62. data/lib/wreq_ruby/error.rb +5 -7
  63. data/lib/wreq_ruby/header.rb +205 -114
  64. data/lib/wreq_ruby/http.rb +74 -0
  65. data/lib/wreq_ruby/response.rb +31 -3
  66. data/script/build_windows_gnu.ps1 +6 -0
  67. data/src/arch.rs +22 -0
  68. data/src/client/body/form.rs +2 -0
  69. data/src/client/body/json.rs +47 -14
  70. data/src/client/body/stream.rs +147 -43
  71. data/src/client/body.rs +11 -15
  72. data/src/client/param.rs +7 -7
  73. data/src/client/req.rs +87 -47
  74. data/src/client/resp.rs +23 -24
  75. data/src/client.rs +310 -230
  76. data/src/cookie.rs +280 -87
  77. data/src/emulate.rs +86 -50
  78. data/src/error.rs +198 -45
  79. data/src/extractor.rs +16 -76
  80. data/src/header.rs +318 -130
  81. data/src/http.rs +62 -33
  82. data/src/lib.rs +26 -20
  83. data/src/macros.rs +71 -46
  84. data/src/options.rs +284 -0
  85. data/src/rt.rs +22 -11
  86. data/src/serde/de/array_deserializer.rs +48 -0
  87. data/src/serde/de/array_enumerator.rs +59 -0
  88. data/src/serde/de/deserializer.rs +307 -0
  89. data/src/serde/de/enum_deserializer.rs +47 -0
  90. data/src/serde/de/hash_deserializer.rs +89 -0
  91. data/src/serde/de/number_deserializer.rs +51 -0
  92. data/src/serde/de/variant_deserializer.rs +101 -0
  93. data/src/serde/de.rs +33 -0
  94. data/src/serde/error.rs +146 -0
  95. data/src/serde/ser/enums.rs +14 -0
  96. data/src/serde/ser/map_serializer.rs +56 -0
  97. data/src/serde/ser/seq_serializer.rs +71 -0
  98. data/src/serde/ser/serializer.rs +194 -0
  99. data/src/serde/ser/struct_serializer.rs +106 -0
  100. data/src/serde/ser/struct_variant_serializer.rs +44 -0
  101. data/src/serde/ser/tuple_variant_serializer.rs +41 -0
  102. data/src/serde/ser.rs +18 -0
  103. data/src/serde/tests.rs +237 -0
  104. data/src/serde.rs +202 -0
  105. data/test/body_sender_test.rb +246 -0
  106. data/test/cookie_test.rb +211 -10
  107. data/test/header_test.rb +228 -192
  108. data/test/json_precision_test.rb +209 -0
  109. data/test/option_validation_test.rb +311 -0
  110. data/test/stream_test.rb +36 -0
  111. data/test/value_semantics_test.rb +238 -0
  112. metadata +77 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b6f6be1747be018573cd9de556975068d57c30a0b25f324d0b89a8f018df1aa
4
- data.tar.gz: 1181f1066b7c5fafb176def4dc1de0a27c192ff3fa9e499afe7f3ec3a70a8b28
3
+ metadata.gz: 87d989f8582c97e03c95ef1fd90d1f089eb35c787da5d9527942548483c1dd55
4
+ data.tar.gz: 413a4656384561df504e9b6a175c2f82c3373693df41bb88cc2ba78c2d319cb4
5
5
  SHA512:
6
- metadata.gz: c641ca408b98ac698cbb17a23c11d78215639793d7a90917058d3de58faa6c89ba403998b49c9b4551b7c237bab0d30e2cb8cfeae161f2c4207d679fb141fdf0
7
- data.tar.gz: 4d57654f2abd06b9d7ad63fb59df28a5ab68bb211479769828384dc87f1ab87fa638c4a39f0215b73b7759dc428b75214afbae91af39febc1c18d4361fc23ab2
6
+ metadata.gz: 2c0b23be854a1bdf4421ec7e32118a41e3c209bded0a32cde470614bf487fdaf48082ad432913a597ef176d14b12eeabcf976ccbddf49d99446ed3f08b5e3710
7
+ data.tar.gz: 53190348795c05829f6119753c6402a6c64a662a72c37ab88616275bbfce47292577348c8f53665d7abf8004d626ded649ff7b7d31d31f99fbc87e7caddef8e7
data/Cargo.lock CHANGED
@@ -113,8 +113,7 @@ dependencies = [
113
113
  [[package]]
114
114
  name = "btls"
115
115
  version = "0.5.6"
116
- source = "registry+https://github.com/rust-lang/crates.io-index"
117
- checksum = "2c5e60b8c8d282c86360cab651ded04ab0335a7b5390c8d34145cbeab8cacf5f"
116
+ source = "git+https://github.com/0x676e67/btls?branch=demo%2Fmerge-upstream-boring-20260616#397dfae69044c0c19ba3028e8b25f8481fbc0f00"
118
117
  dependencies = [
119
118
  "bitflags",
120
119
  "btls-sys",
@@ -126,8 +125,7 @@ dependencies = [
126
125
  [[package]]
127
126
  name = "btls-sys"
128
127
  version = "0.5.6"
129
- source = "registry+https://github.com/rust-lang/crates.io-index"
130
- checksum = "9b1b8638a2e1c38a5ae4efa90ae57e643baec35a30d03fc5b399b893adc4954b"
128
+ source = "git+https://github.com/0x676e67/btls?branch=demo%2Fmerge-upstream-boring-20260616#397dfae69044c0c19ba3028e8b25f8481fbc0f00"
131
129
  dependencies = [
132
130
  "bindgen",
133
131
  "cmake",
@@ -1001,12 +999,23 @@ dependencies = [
1001
999
  "zmij",
1002
1000
  ]
1003
1001
 
1002
+ [[package]]
1003
+ name = "serde_ignored"
1004
+ version = "0.1.14"
1005
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1006
+ checksum = "115dffd5f3853e06e746965a20dcbae6ee747ae30b543d91b0e089668bb07798"
1007
+ dependencies = [
1008
+ "serde",
1009
+ "serde_core",
1010
+ ]
1011
+
1004
1012
  [[package]]
1005
1013
  name = "serde_json"
1006
1014
  version = "1.0.150"
1007
1015
  source = "registry+https://github.com/rust-lang/crates.io-index"
1008
1016
  checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9"
1009
1017
  dependencies = [
1018
+ "indexmap",
1010
1019
  "itoa",
1011
1020
  "memchr",
1012
1021
  "serde",
@@ -1015,14 +1024,14 @@ dependencies = [
1015
1024
  ]
1016
1025
 
1017
1026
  [[package]]
1018
- name = "serde_magnus"
1019
- version = "0.11.0"
1027
+ name = "serde_path_to_error"
1028
+ version = "0.1.20"
1020
1029
  source = "registry+https://github.com/rust-lang/crates.io-index"
1021
- checksum = "8ff64c88ddd26acdcad5a501f18bcc339927b77b69f4a03bfaf2a6fc5ba2ac4b"
1030
+ checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457"
1022
1031
  dependencies = [
1023
- "magnus",
1032
+ "itoa",
1024
1033
  "serde",
1025
- "tap",
1034
+ "serde_core",
1026
1035
  ]
1027
1036
 
1028
1037
  [[package]]
@@ -1139,12 +1148,6 @@ dependencies = [
1139
1148
  "libc",
1140
1149
  ]
1141
1150
 
1142
- [[package]]
1143
- name = "tap"
1144
- version = "1.0.1"
1145
- source = "registry+https://github.com/rust-lang/crates.io-index"
1146
- checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
1147
-
1148
1151
  [[package]]
1149
1152
  name = "thiserror"
1150
1153
  version = "1.0.69"
@@ -1537,7 +1540,7 @@ dependencies = [
1537
1540
 
1538
1541
  [[package]]
1539
1542
  name = "wreq-ruby"
1540
- version = "1.2.4"
1543
+ version = "1.2.6"
1541
1544
  dependencies = [
1542
1545
  "arc-swap",
1543
1546
  "bytes",
@@ -1550,7 +1553,9 @@ dependencies = [
1550
1553
  "rb-sys",
1551
1554
  "rb-sys-env",
1552
1555
  "serde",
1553
- "serde_magnus",
1556
+ "serde_ignored",
1557
+ "serde_json",
1558
+ "serde_path_to_error",
1554
1559
  "tokio",
1555
1560
  "wreq",
1556
1561
  "wreq-util",
@@ -1559,8 +1564,6 @@ dependencies = [
1559
1564
  [[package]]
1560
1565
  name = "wreq-util"
1561
1566
  version = "3.0.0-rc.14"
1562
- source = "registry+https://github.com/rust-lang/crates.io-index"
1563
- checksum = "1d8d73c75be86fbde675988dbe5cb15f02567025c13f6ffab910361ad1ba6c89"
1564
1567
  dependencies = [
1565
1568
  "brotli",
1566
1569
  "flate2",
data/Cargo.toml CHANGED
@@ -6,7 +6,7 @@ homepage = "https://github.com/SearchApi/wreq-ruby"
6
6
  repository = "https://github.com/SearchApi/wreq-ruby"
7
7
  edition = "2024"
8
8
  rust-version = "1.85"
9
- version = "1.2.4"
9
+ version = "1.2.6"
10
10
 
11
11
  [lib]
12
12
  crate-type = ["cdylib"]
@@ -33,7 +33,12 @@ wreq = { version = "6.0.0-rc", features = [
33
33
  ] }
34
34
  wreq-util = { version = "3.0.0-rc", features = ["emulation-compression"] }
35
35
  serde = { version = "1.0.228", features = ["derive"] }
36
- serde_magnus = "0.11.0"
36
+ serde_ignored = "0.1.14"
37
+ serde_json = { version = "1.0.150", features = [
38
+ "arbitrary_precision",
39
+ "preserve_order",
40
+ ] }
41
+ serde_path_to_error = "0.1.20"
37
42
  indexmap = { version = "2.14.0", features = ["serde"] }
38
43
  cookie = "0.18.1"
39
44
  bytes = "1.12.1"
@@ -42,6 +47,9 @@ http = "1.4.1"
42
47
  http-body-util = "0.1.3"
43
48
  futures-util = { version = "0.3.32", default-features = false }
44
49
 
50
+ [dev-dependencies]
51
+ magnus = { version = "0.8.2", features = ["embed"] }
52
+
45
53
  [build-dependencies]
46
54
  rb-sys-env = "0.2.2"
47
55
 
@@ -52,3 +60,8 @@ incremental = false
52
60
  lto = "fat"
53
61
  opt-level = 3
54
62
  strip = true
63
+
64
+ [patch.crates-io]
65
+ btls = { git = "https://github.com/0x676e67/btls", branch = "demo/merge-upstream-boring-20260616" }
66
+ btls-sys = { git = "https://github.com/0x676e67/btls", branch = "demo/merge-upstream-boring-20260616" }
67
+ wreq-util = { path = "crates/wreq-util" }
@@ -0,0 +1,15 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi:
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12
+ polar: # Replace with a single Polar username
13
+ buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14
+ thanks_dev: # Replace with a single thanks.dev username
15
+ custom: ['https://github.com/0x676e67/0x676e67/blob/main/SPONSOR.md']
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Describe the bug**
11
+ A clear and concise description of what the bug is.
12
+
13
+ **To Reproduce**
14
+ Steps to reproduce the behavior:
15
+ 1. Go to '...'
16
+ 2. Click on '....'
17
+ 3. Scroll down to '....'
18
+ 4. See error
19
+
20
+ **Expected behavior**
21
+ A clear and concise description of what you expected to happen.
22
+
23
+ **Screenshots**
24
+ If applicable, add screenshots to help explain your problem.
25
+
26
+ **Desktop (please complete the following information):**
27
+ - OS: [e.g. iOS]
28
+ - Browser [e.g. chrome, safari]
29
+ - Version [e.g. 22]
30
+
31
+ **Smartphone (please complete the following information):**
32
+ - Device: [e.g. iPhone6]
33
+ - OS: [e.g. iOS8.1]
34
+ - Browser [e.g. stock browser, safari]
35
+ - Version [e.g. 22]
36
+
37
+ **Additional context**
38
+ Add any other context about the problem here.
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: Custom issue template
3
+ about: Describe this issue template's purpose here.
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12
+
13
+ **Describe the solution you'd like**
14
+ A clear and concise description of what you want to happen.
15
+
16
+ **Describe alternatives you've considered**
17
+ A clear and concise description of any alternative solutions or features you've considered.
18
+
19
+ **Additional context**
20
+ Add any other context or screenshots about the feature request here.
@@ -0,0 +1,22 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "github-actions"
9
+ # Workflow files stored in the
10
+ # default location of `.github/workflows`
11
+ directory: "/"
12
+ schedule:
13
+ interval: "weekly"
14
+ - package-ecosystem: "cargo"
15
+ directory: "/"
16
+ schedule:
17
+ interval: "weekly"
18
+ # todo: if only this worked, see https://github.com/dependabot/dependabot-core/issues/4009
19
+ # only tell us if there's a new 'breaking' change we could upgrade to
20
+ # versioning-strategy: increase-if-necessary
21
+ # disable regular version updates, security updates are unaffected
22
+ open-pull-requests-limit: 0
@@ -0,0 +1,82 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+ pull_request:
7
+ workflow_dispatch:
8
+
9
+ concurrency:
10
+ group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
11
+ cancel-in-progress: true
12
+
13
+ permissions:
14
+ contents: write
15
+ packages: write
16
+
17
+ jobs:
18
+ style:
19
+ name: Style
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v7
23
+ - uses: actions-rs/toolchain@v1
24
+ with:
25
+ toolchain: stable
26
+ override: true
27
+ - name: Style check
28
+ run: cargo fmt --all -- --check
29
+ - name: Clippy check
30
+ run: cargo clippy --all-targets --all-features
31
+
32
+ docs:
33
+ name: Docs
34
+ runs-on: ubuntu-latest
35
+ steps:
36
+ - uses: actions/checkout@v7
37
+ - uses: actions-rs/toolchain@v1
38
+ with:
39
+ toolchain: stable
40
+ override: true
41
+ - name: Build docs
42
+ run: cargo doc --document-private-items --all-features
43
+
44
+ tests:
45
+ name: Tests
46
+ runs-on: ubuntu-latest
47
+ steps:
48
+ - uses: actions/checkout@v7
49
+ - uses: actions-rs/toolchain@v1
50
+ with:
51
+ toolchain: stable
52
+ override: true
53
+ - uses: taiki-e/install-action@v2
54
+ with:
55
+ tool: cargo-nextest
56
+ - name: Tests
57
+ run: |
58
+ set -euxo pipefail
59
+ cargo nextest run --workspace
60
+
61
+ linux:
62
+ name: Linux
63
+ needs: [style, tests, docs]
64
+ runs-on: ubuntu-latest
65
+ environment: Linux
66
+ if: startsWith(github.ref, 'refs/tags/')
67
+ steps:
68
+ - uses: actions/checkout@v7
69
+ - uses: actions-rs/toolchain@v1
70
+ with:
71
+ toolchain: stable
72
+ override: true
73
+ - uses: katyo/publish-crates@v2
74
+ with:
75
+ registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
76
+ ignore-unpublished-changes: true
77
+ - name: Upload binaries to GitHub Release
78
+ uses: softprops/action-gh-release@v3
79
+ with:
80
+ token: ${{ secrets.GITHUB_TOKEN }}
81
+ prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') }}
82
+ generate_release_notes: true
@@ -0,0 +1,52 @@
1
+ name: Release-plz
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ release-plz-release:
10
+ name: Release-plz release
11
+ runs-on: ubuntu-latest
12
+ if: ${{ github.repository_owner == '0x676e67' }}
13
+ permissions:
14
+ contents: write
15
+ id-token: write
16
+ steps:
17
+ - &checkout
18
+ name: Checkout repository
19
+ uses: actions/checkout@v7
20
+ with:
21
+ fetch-depth: 0
22
+ persist-credentials: true
23
+ token: ${{ secrets.RELEASE_PLZ_TOKEN }}
24
+ - &install-rust
25
+ name: Install Rust toolchain
26
+ uses: dtolnay/rust-toolchain@stable
27
+ - name: Run release-plz
28
+ uses: release-plz/action@v0.5
29
+ with:
30
+ command: release
31
+ env:
32
+ GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
33
+
34
+ release-plz-pr:
35
+ name: Release-plz PR
36
+ runs-on: ubuntu-latest
37
+ if: ${{ github.repository_owner == '0x676e67' }}
38
+ permissions:
39
+ pull-requests: write
40
+ contents: write
41
+ concurrency:
42
+ group: release-plz-${{ github.ref }}
43
+ cancel-in-progress: false
44
+ steps:
45
+ - *checkout
46
+ - *install-rust
47
+ - name: Run release-plz
48
+ uses: release-plz/action@v0.5
49
+ with:
50
+ command: release-pr
51
+ env:
52
+ GITHUB_TOKEN: ${{ secrets.RELEASE_PLZ_TOKEN }}
@@ -0,0 +1,24 @@
1
+ # Generated by Cargo
2
+ # will have compiled files and executables
3
+ debug
4
+ target
5
+ Cargo.lock
6
+
7
+ # These are backup files generated by rustfmt
8
+ **/*.rs.bk
9
+
10
+ # MSVC Windows builds of rustc generate these, which store debugging information
11
+ *.pdb
12
+
13
+ # Generated by cargo mutants
14
+ # Contains mutation testing data
15
+ **/mutants.out*/
16
+
17
+ # RustRover
18
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
19
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
20
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
21
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
22
+ #.idea/
23
+ .vscode
24
+ .zed
@@ -0,0 +1,74 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [3.0.0-rc.14](https://github.com/0x676e67/wreq-util/compare/v3.0.0-rc.13...v3.0.0-rc.14) - 2026-07-04
11
+
12
+ ### Fixed
13
+
14
+ - *(emulate)* Fix chrome accept header `q` value ([#101](https://github.com/0x676e67/wreq-util/pull/101))
15
+
16
+ ### Other
17
+
18
+ - *(deps)* bump actions/checkout from 6 to 7 ([#100](https://github.com/0x676e67/wreq-util/pull/100))
19
+
20
+ ## [3.0.0-rc.13](https://github.com/0x676e67/wreq-util/compare/v3.0.0-rc.12...v3.0.0-rc.13) - 2026-06-19
21
+
22
+ ### Added
23
+
24
+ - add Emulation::weighted_random for traffic-weighted profile selection ([#97](https://github.com/0x676e67/wreq-util/pull/97))
25
+
26
+ ### Other
27
+
28
+ - Add Chrome 149 to emulation profiles ([#99](https://github.com/0x676e67/wreq-util/pull/99))
29
+
30
+ ## [3.0.0-rc.12](https://github.com/0x676e67/wreq-util/compare/v3.0.0-rc.11...v3.0.0-rc.12) - 2026-06-03
31
+
32
+ ### Added
33
+
34
+ - *(emulate)* Add Firefox 150-151 ([#93](https://github.com/0x676e67/wreq-util/pull/93))
35
+ - *(emulate)* Add Chrome/Edge 148,Opera 131,Safari 26-2/4 ([#92](https://github.com/0x676e67/wreq-util/pull/92))
36
+ - *(emulate)* export enum variants ([#87](https://github.com/0x676e67/wreq-util/pull/87))
37
+ - *(emulation)* add Chrome and Edge 146-147 ([#86](https://github.com/0x676e67/wreq-util/pull/86))
38
+ - *(emulation)* add Opera 120-130 and Firefox 148-149 support ([#82](https://github.com/0x676e67/wreq-util/pull/82))
39
+
40
+ ### Fixed
41
+
42
+ - *(emulate)* fix HTTP2 configuration for OkHttp ([#94](https://github.com/0x676e67/wreq-util/pull/94))
43
+ - fix build
44
+ - fix chrome grease value and brand order ([#91](https://github.com/0x676e67/wreq-util/pull/91))
45
+ - fix
46
+
47
+ ### Other
48
+
49
+ - Update Cargo.toml
50
+ - Update Cargo.toml
51
+ - Update README.md
52
+ - fix docs build ([#95](https://github.com/0x676e67/wreq-util/pull/95))
53
+ - Update wreq and wreq-util versions in README
54
+ - release-plz.yml
55
+ - *(deps)* bump softprops/action-gh-release from 2 to 3 ([#89](https://github.com/0x676e67/wreq-util/pull/89))
56
+ - Add Discord chat badge to README
57
+ - Add rustfmt configuration settings
58
+ - Update issue submission instructions in README
59
+ - Update Cargo.toml
60
+ - Update copyright year and owner in LICENSE file
61
+ - Revise contributing section and add FAQ
62
+ - Update Apache-2.0
63
+ - export
64
+ - Update Cargo.toml
65
+ - update deps
66
+ - update
67
+ - *(macros)* fmt code ([#85](https://github.com/0x676e67/wreq-util/pull/85))
68
+ - *(macros)* fmt code
69
+ - Fix variable naming in emulate.rs
70
+ - *(emulation)* refine abstraction for emulation settings ([#84](https://github.com/0x676e67/wreq-util/pull/84))
71
+ - fmt
72
+ - Change 'Overview' header to 'Features'
73
+ - *(mod)* use `emulate` when applying `emulation` ([#83](https://github.com/0x676e67/wreq-util/pull/83))
74
+ - Update `Contributing` section in `README.md` ([#81](https://github.com/0x676e67/wreq-util/pull/81))
@@ -0,0 +1,94 @@
1
+ [package]
2
+ name = "wreq-util"
3
+ description = "Common utilities for wreq"
4
+ repository = "https://github.com/0x676e67/wreq-util"
5
+ documentation = "https://docs.rs/wreq-util"
6
+ keywords = ["http", "client", "emulation", "ja3", "ja4"]
7
+ authors = ["0x676e67 <gngppz@gmail.com>"]
8
+ version = "3.0.0-rc.14"
9
+ readme = "README.md"
10
+ license = "Apache-2.0"
11
+ edition = "2024"
12
+ rust-version = "1.85"
13
+
14
+ [package.metadata.docs.rs]
15
+ all-features = true
16
+ rustdoc-args = ["--cfg", "docsrs"]
17
+ targets = ["x86_64-unknown-linux-gnu"]
18
+
19
+ [features]
20
+ default = ["emulation"]
21
+
22
+ tokio-rt = ["wreq/tokio-rt"]
23
+ compio-rt = ["wreq/compio-rt"]
24
+
25
+ emulation = ["dep:typed-builder", "dep:brotli", "dep:flate2", "dep:zstd"]
26
+ emulation-serde = ["dep:serde"]
27
+ emulation-compression = []
28
+
29
+ tower-delay = ["dep:tower", "dep:pin-project-lite", "tokio/time"]
30
+
31
+ [dependencies]
32
+ wreq = { version = "6.0.0-rc", default-features = false }
33
+
34
+ # Optional deps...
35
+
36
+ serde = { version = "1.0.228", features = ["derive"], optional = true }
37
+ tokio = { version = "1.52.1", default-features = false, optional = true }
38
+ tower = { version = "0.5.2", default-features = false, optional = true }
39
+ typed-builder = { version = "0.23.2", optional = true }
40
+ pin-project-lite = { version = "0.2.17", optional = true }
41
+
42
+ ## Compression algorithms
43
+ brotli = { version = "8.0.2", optional = true }
44
+ flate2 = { version = "1.1.9", optional = true }
45
+ zstd = { version = "0.13.3", optional = true }
46
+
47
+ [dev-dependencies]
48
+ wreq = "6.0.0-rc"
49
+ tokio = { version = "1.48.0", features = ["full"] }
50
+ hyper = { version = "1.10.1", default-features = false, features = [
51
+ "http1",
52
+ "http2",
53
+ "server",
54
+ ] }
55
+ hyper-util = { version = "0.1.20", features = [
56
+ "http1",
57
+ "http2",
58
+ "server-auto",
59
+ "tokio",
60
+ ] }
61
+ http = "1"
62
+
63
+ [lib]
64
+ doctest = false
65
+
66
+ [[test]]
67
+ name = "client"
68
+ path = "tests/client.rs"
69
+
70
+ [[test]]
71
+ name = "emulate_chrome"
72
+ path = "tests/emulate_chrome.rs"
73
+
74
+ [[test]]
75
+ name = "emulate_okhttp"
76
+ path = "tests/emulate_okhttp.rs"
77
+
78
+ [[test]]
79
+ name = "emulate_firefox"
80
+ path = "tests/emulate_firefox.rs"
81
+
82
+ [[test]]
83
+ name = "emulate_safari"
84
+ path = "tests/emulate_safari.rs"
85
+
86
+ [[example]]
87
+ name = "emulate"
88
+ path = "examples/emulate.rs"
89
+ required-features = ["emulation"]
90
+
91
+ [[example]]
92
+ name = "tower_delay"
93
+ path = "examples/tower_delay.rs"
94
+ required-features = ["tower-delay"]