never-primp 2.4.0__tar.gz → 2.4.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 (39) hide show
  1. {never_primp-2.4.0 → never_primp-2.4.2}/.github/workflows/build.yml +69 -69
  2. {never_primp-2.4.0 → never_primp-2.4.2}/Cargo.lock +13 -310
  3. never_primp-2.4.2/Cargo.toml +58 -0
  4. {never_primp-2.4.0 → never_primp-2.4.2}/PKG-INFO +1 -1
  5. {never_primp-2.4.0 → never_primp-2.4.2}/example/basic_usage.py +4 -3
  6. never_primp-2.4.2/example/tls_check.py +39 -0
  7. {never_primp-2.4.0 → never_primp-2.4.2}/pyproject.toml +1 -1
  8. {never_primp-2.4.0 → never_primp-2.4.2}/src/client.rs +39 -5
  9. never_primp-2.4.0/Cargo.toml +0 -62
  10. {never_primp-2.4.0 → never_primp-2.4.2}/.claude/settings.local.json +0 -0
  11. {never_primp-2.4.0 → never_primp-2.4.2}/.gitignore +0 -0
  12. {never_primp-2.4.0 → never_primp-2.4.2}/BUILD_STATUS.md +0 -0
  13. {never_primp-2.4.0 → never_primp-2.4.2}/COMPLETION_REPORT.md +0 -0
  14. {never_primp-2.4.0 → never_primp-2.4.2}/HEADER_IMPROVEMENTS.md +0 -0
  15. {never_primp-2.4.0 → never_primp-2.4.2}/LICENSE +0 -0
  16. {never_primp-2.4.0 → never_primp-2.4.2}/OPTIMIZATION_SUMMARY.md +0 -0
  17. {never_primp-2.4.0 → never_primp-2.4.2}/README.md +0 -0
  18. {never_primp-2.4.0 → never_primp-2.4.2}/SPLIT_COOKIES.md +0 -0
  19. {never_primp-2.4.0 → never_primp-2.4.2}/SUMMARY.md +0 -0
  20. {never_primp-2.4.0 → never_primp-2.4.2}/docs/IDE_GUIDE.md +0 -0
  21. {never_primp-2.4.0 → never_primp-2.4.2}/docs//345/256/214/345/226/204/345/260/201/350/243/205/346/200/273/347/273/223.md" +0 -0
  22. {never_primp-2.4.0 → never_primp-2.4.2}/docs//345/277/253/351/200/237/345/274/200/345/247/213_/346/231/272/350/203/275/346/217/220/347/244/272.md" +0 -0
  23. {never_primp-2.4.0 → never_primp-2.4.2}/example/browser_impersonation.py +0 -0
  24. {never_primp-2.4.0 → never_primp-2.4.2}/example/concurrent_requests.py +0 -0
  25. {never_primp-2.4.0 → never_primp-2.4.2}/example/cookie_management.py +0 -0
  26. {never_primp-2.4.0 → never_primp-2.4.2}/example/header_management_demo.py +0 -0
  27. {never_primp-2.4.0 → never_primp-2.4.2}/example/response_guide.py +0 -0
  28. {never_primp-2.4.0 → never_primp-2.4.2}/example/type_hints_demo.py +0 -0
  29. {never_primp-2.4.0 → never_primp-2.4.2}/never_primp/__init__.py +0 -0
  30. {never_primp-2.4.0 → never_primp-2.4.2}/never_primp/never_primp.pyi +0 -0
  31. {never_primp-2.4.0 → never_primp-2.4.2}/never_primp/py.typed +0 -0
  32. {never_primp-2.4.0 → never_primp-2.4.2}/src/browser_mapping.rs +0 -0
  33. {never_primp-2.4.0 → never_primp-2.4.2}/src/error.rs +0 -0
  34. {never_primp-2.4.0 → never_primp-2.4.2}/src/lib.rs +0 -0
  35. {never_primp-2.4.0 → never_primp-2.4.2}/src/response.rs +0 -0
  36. {never_primp-2.4.0 → never_primp-2.4.2}/src/runtime.rs +0 -0
  37. {never_primp-2.4.0 → never_primp-2.4.2}/src/types.rs +0 -0
  38. {never_primp-2.4.0 → never_primp-2.4.2}/src/utils.rs +0 -0
  39. {never_primp-2.4.0 → never_primp-2.4.2}/test.py +0 -0
@@ -26,6 +26,7 @@ permissions:
26
26
 
27
27
  jobs:
28
28
  # ==================== Linux 平台构建 ====================
29
+ # 覆盖目标:glibc (manylinux) x86_64/aarch64 + musl x86_64/aarch64
29
30
  build-linux:
30
31
  name: Build Linux ${{ matrix.target }}
31
32
  runs-on: ubuntu-latest
@@ -35,38 +36,25 @@ jobs:
35
36
  strategy:
36
37
  fail-fast: false
37
38
  matrix:
38
- target:
39
- - x86_64 # Linux x64 (最常用)
40
- # - aarch64 # Linux ARM64 (服务器)
39
+ include:
40
+ # glibc 2.28+:兼容主流 Linux 发行版(Ubuntu 18.04+, Debian 10+, CentOS 8+)
41
+ - target: x86_64
42
+ manylinux: '2_28'
43
+ # musl x86_64:Alpine Linux / Docker scratch / 静态链接二进制
44
+ - target: x86_64-unknown-linux-musl
45
+ manylinux: 'musllinux_1_2'
46
+
47
+
41
48
  steps:
42
49
  - uses: actions/checkout@v4
50
+
43
51
  - name: Configure git to use GitHub token
44
52
  run: |
45
53
  git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
46
54
 
47
55
  - uses: actions/setup-python@v5
48
56
  with:
49
- python-version: '3.9'
50
-
51
- - name: Install dependencies
52
- run: |
53
- sudo apt-get update
54
- sudo apt-get install -y \
55
- libclang-dev \
56
- clang \
57
- cmake \
58
- build-essential \
59
- pkg-config \
60
- gcc-multilib \
61
- libssl-dev
62
-
63
- - name: Find and set libclang path
64
- run: |
65
- # 查找 libclang.so 并设置环境变量
66
- LIBCLANG_PATH=$(find /usr/lib -name "libclang.so*" | head -1 | xargs dirname)
67
- echo "LIBCLANG_PATH=$LIBCLANG_PATH" >> $GITHUB_ENV
68
- echo "Found libclang at: $LIBCLANG_PATH"
69
- ls -la $LIBCLANG_PATH/libclang.so* || true
57
+ python-version: '3.11'
70
58
 
71
59
  - name: Build wheels
72
60
  env:
@@ -76,29 +64,44 @@ jobs:
76
64
  target: ${{ matrix.target }}
77
65
  args: --release --out dist --find-interpreter
78
66
  sccache: 'true'
79
- manylinux: ${{ matrix.target == 'x86_64' && '2_28' || '2_28' }}
67
+ manylinux: ${{ matrix.manylinux }}
80
68
  before-script-linux: |
81
69
  git config --global url."https://x-access-token:$MATURIN_GIT_TOKEN@github.com/".insteadOf "https://github.com/"
82
- # 检测包管理器并安装依赖
83
- if command -v yum &> /dev/null; then
84
- echo "Using yum (manylinux container)"
85
- yum install -y clang llvm-devel cmake glibc-devel glibc-headers kernel-headers
86
-
87
- # 设置 bindgen clang 参数,确保能找到系统头文件
88
- ARCH=$(uname -m)
89
- export BINDGEN_EXTRA_CLANG_ARGS="-I/usr/include -I/usr/include/$ARCH-linux-gnu"
90
- echo "BINDGEN_EXTRA_CLANG_ARGS=$BINDGEN_EXTRA_CLANG_ARGS"
91
-
92
- # 查找并设置 libclang
93
- export LIBCLANG_PATH="${LIBCLANG_PATH:-$(find /usr/lib* -name "libclang.so*" 2>/dev/null | head -1 | xargs dirname 2>/dev/null || echo "/usr/lib64")}"
94
- echo "Using LIBCLANG_PATH=$LIBCLANG_PATH"
70
+
71
+ ARCH=$(uname -m)
72
+ LIBCLANG_PATH=""
73
+ BINDGEN_EXTRA_CLANG_ARGS=""
74
+
75
+ if command -v apk &> /dev/null; then
76
+ # ── musl/Alpine 容器 ──────────────────────────────────────
77
+ echo "Detected Alpine (musl) container"
78
+ apk add --no-cache clang llvm-dev cmake make musl-dev perl
79
+
80
+ LIBCLANG_PATH=$(find /usr/lib/llvm*/lib -name "libclang.so*" 2>/dev/null | head -1 | xargs dirname 2>/dev/null || true)
81
+ LIBCLANG_PATH="${LIBCLANG_PATH:-/usr/lib}"
82
+ BINDGEN_EXTRA_CLANG_ARGS="-I/usr/include"
83
+
84
+ elif command -v yum &> /dev/null; then
85
+ # ── manylinux 容器(CentOS/RHEL 基底) ───────────────────
86
+ echo "Detected manylinux container (yum)"
87
+ yum install -y clang llvm-devel cmake perl-core glibc-devel glibc-headers kernel-headers
88
+
89
+ LIBCLANG_PATH=$(find /usr/lib* -name "libclang.so*" 2>/dev/null | head -1 | xargs dirname 2>/dev/null || true)
90
+ LIBCLANG_PATH="${LIBCLANG_PATH:-/usr/lib64}"
91
+ BINDGEN_EXTRA_CLANG_ARGS="-I/usr/include -I/usr/include/$ARCH-linux-gnu"
92
+
95
93
  else
96
- echo "Not in manylinux container, using host dependencies"
94
+ echo "Unknown container environment, using system defaults"
95
+ LIBCLANG_PATH=$(find /usr/lib* -name "libclang.so*" 2>/dev/null | head -1 | xargs dirname 2>/dev/null || true)
96
+ LIBCLANG_PATH="${LIBCLANG_PATH:-/usr/lib}"
97
97
  fi
98
98
 
99
- # 验证
100
- ls -la $LIBCLANG_PATH/libclang* 2>/dev/null || echo "libclang not found, relying on system defaults"
101
- clang --version 2>/dev/null || echo "clang not in PATH"
99
+ export LIBCLANG_PATH
100
+ export BINDGEN_EXTRA_CLANG_ARGS
101
+
102
+ echo "LIBCLANG_PATH=$LIBCLANG_PATH"
103
+ echo "BINDGEN_EXTRA_CLANG_ARGS=$BINDGEN_EXTRA_CLANG_ARGS"
104
+ clang --version 2>/dev/null || echo "clang not found in PATH"
102
105
 
103
106
  - name: List built wheels
104
107
  run: ls -lh dist/
@@ -119,18 +122,23 @@ jobs:
119
122
  strategy:
120
123
  fail-fast: false
121
124
  matrix:
122
- target: [x64]
125
+ target:
126
+ - x64 # Windows x86_64(主流桌面/服务器)
127
+ - x86 # Windows x86(32 位兼容)
128
+
123
129
  steps:
124
130
  - uses: actions/checkout@v4
131
+
125
132
  - name: Configure git to use GitHub token
126
133
  shell: bash
127
134
  run: |
128
135
  git config --global url."https://x-access-token:$GITHUB_TOKEN@github.com/".insteadOf "https://github.com/"
129
136
  env:
130
137
  GITHUB_TOKEN: ${{ secrets.DD_TOKEN }}
138
+
131
139
  - uses: actions/setup-python@v5
132
140
  with:
133
- python-version: '3.9'
141
+ python-version: '3.11'
134
142
  architecture: ${{ matrix.target }}
135
143
 
136
144
  - name: Build wheels
@@ -145,15 +153,6 @@ jobs:
145
153
  - name: List built wheels
146
154
  run: dir dist
147
155
 
148
- - name: Debug wheel contents
149
- shell: powershell
150
- run: |
151
- $wheel = Get-ChildItem dist\*.whl | Select-Object -First 1
152
- Write-Host "=== Wheel contents ==="
153
- python -m zipfile -l $wheel
154
- Write-Host "`n=== Looking for never_primp files ==="
155
- python -m zipfile -l $wheel | Select-String "never_primp"
156
-
157
156
  - name: Upload wheels
158
157
  uses: actions/upload-artifact@v4
159
158
  with:
@@ -171,16 +170,19 @@ jobs:
171
170
  fail-fast: false
172
171
  matrix:
173
172
  target:
174
- - x86_64 # Intel Mac
175
- - aarch64 # Apple Silicon (M1/M2/M3)
173
+ - x86_64 # Intel Mac(macOS 10.12+)
174
+ - aarch64 # Apple Silicon M1/M2/M3/M4
175
+
176
176
  steps:
177
177
  - uses: actions/checkout@v4
178
+
178
179
  - name: Configure git to use GitHub token
179
180
  run: |
180
181
  git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
182
+
181
183
  - uses: actions/setup-python@v5
182
184
  with:
183
- python-version: '3.9'
185
+ python-version: '3.11'
184
186
 
185
187
  - name: Build wheels
186
188
  env:
@@ -209,9 +211,11 @@ jobs:
209
211
  MATURIN_GIT_TOKEN: ${{ secrets.DD_TOKEN }}
210
212
  steps:
211
213
  - uses: actions/checkout@v4
214
+
212
215
  - name: Configure git to use GitHub token
213
216
  run: |
214
217
  git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
218
+
215
219
  - name: Build sdist
216
220
  uses: PyO3/maturin-action@v1
217
221
  with:
@@ -228,9 +232,11 @@ jobs:
228
232
  path: dist
229
233
 
230
234
  # ==================== 发布到 PyPI ====================
235
+ # 仅在 tag 推送(v*.*.*)或手动指定 publish_to_pypi=true 时执行
231
236
  publish-to-pypi:
232
237
  name: Publish to PyPI
233
238
  runs-on: ubuntu-latest
239
+
234
240
  needs: [build-linux, build-windows, build-macos, build-sdist]
235
241
 
236
242
  steps:
@@ -244,17 +250,14 @@ jobs:
244
250
  - name: List all packages
245
251
  run: |
246
252
  echo "========================================="
247
- echo "📦 准备发布的所有包:"
253
+ echo "准备发布的所有包:"
248
254
  echo "========================================="
249
255
  ls -lh dist/
250
256
  echo ""
251
- echo "========================================="
252
- echo "📋 包列表:"
253
- echo "========================================="
257
+ echo "包列表(共 $(ls dist/ | wc -l) 个):"
254
258
  for file in dist/*; do
255
- echo " $(basename $file)"
259
+ echo " $(basename $file)"
256
260
  done
257
- echo ""
258
261
  echo "========================================="
259
262
 
260
263
  - name: Publish to PyPI
@@ -268,11 +271,8 @@ jobs:
268
271
  - name: Success message
269
272
  run: |
270
273
  echo "========================================="
271
- echo "发布成功!"
274
+ echo "发布成功!"
275
+ echo "========================================="
276
+ echo "pip install never_primp"
277
+ echo "https://pypi.org/project/never_primp/"
272
278
  echo "========================================="
273
- echo "用户现在可以通过以下命令安装:"
274
- echo " pip install never_primp"
275
- echo ""
276
- echo "查看项目:"
277
- echo " https://pypi.org/project/never_primp/"
278
- echo "========================================="
@@ -44,15 +44,6 @@ version = "1.0.102"
44
44
  source = "registry+https://github.com/rust-lang/crates.io-index"
45
45
  checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c"
46
46
 
47
- [[package]]
48
- name = "arc-swap"
49
- version = "1.8.2"
50
- source = "registry+https://github.com/rust-lang/crates.io-index"
51
- checksum = "f9f3647c145568cec02c42054e07bdf9a5a698e15b466fb2341bfc393cd24aa5"
52
- dependencies = [
53
- "rustversion",
54
- ]
55
-
56
47
  [[package]]
57
48
  name = "async-compression"
58
49
  version = "0.4.41"
@@ -71,12 +62,6 @@ version = "1.1.2"
71
62
  source = "registry+https://github.com/rust-lang/crates.io-index"
72
63
  checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0"
73
64
 
74
- [[package]]
75
- name = "base64"
76
- version = "0.22.1"
77
- source = "registry+https://github.com/rust-lang/crates.io-index"
78
- checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
79
-
80
65
  [[package]]
81
66
  name = "bindgen"
82
67
  version = "0.72.1"
@@ -124,9 +109,9 @@ dependencies = [
124
109
 
125
110
  [[package]]
126
111
  name = "btls"
127
- version = "0.5.3"
112
+ version = "0.5.4"
128
113
  source = "registry+https://github.com/rust-lang/crates.io-index"
129
- checksum = "5395615506d423c716eb9d578c6cce87c583a9756e4dc46ffe59ac19dd6fe5f9"
114
+ checksum = "0225e25af0fffc06c67ec4b965a4aeccc6fd01bfdb7660b6b6d437318fafd39f"
130
115
  dependencies = [
131
116
  "bitflags",
132
117
  "btls-sys",
@@ -137,9 +122,9 @@ dependencies = [
137
122
 
138
123
  [[package]]
139
124
  name = "btls-sys"
140
- version = "0.5.3"
125
+ version = "0.5.4"
141
126
  source = "registry+https://github.com/rust-lang/crates.io-index"
142
- checksum = "6bbf6abde429d7f18aa7e8461d67d5da2b9b8545483dc580cc16f582702bb871"
127
+ checksum = "6c5faf2e4ba808c04831a4bd77ac9a26256b25efdf3bc59e846b77e083a86cef"
143
128
  dependencies = [
144
129
  "bindgen",
145
130
  "cmake",
@@ -280,22 +265,6 @@ version = "1.0.2"
280
265
  source = "registry+https://github.com/rust-lang/crates.io-index"
281
266
  checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
282
267
 
283
- [[package]]
284
- name = "errno"
285
- version = "0.3.14"
286
- source = "registry+https://github.com/rust-lang/crates.io-index"
287
- checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
288
- dependencies = [
289
- "libc",
290
- "windows-sys",
291
- ]
292
-
293
- [[package]]
294
- name = "fastrand"
295
- version = "2.3.0"
296
- source = "registry+https://github.com/rust-lang/crates.io-index"
297
- checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
298
-
299
268
  [[package]]
300
269
  name = "find-msvc-tools"
301
270
  version = "0.1.9"
@@ -450,28 +419,6 @@ version = "0.5.0"
450
419
  source = "registry+https://github.com/rust-lang/crates.io-index"
451
420
  checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
452
421
 
453
- [[package]]
454
- name = "html2text"
455
- version = "0.16.7"
456
- source = "registry+https://github.com/rust-lang/crates.io-index"
457
- checksum = "12d23156ea4dbe6b37ad48fab2da56ff27b0f6192fb5db210c44eb07bfe6e787"
458
- dependencies = [
459
- "html5ever",
460
- "tendril",
461
- "thiserror 2.0.18",
462
- "unicode-width",
463
- ]
464
-
465
- [[package]]
466
- name = "html5ever"
467
- version = "0.38.0"
468
- source = "registry+https://github.com/rust-lang/crates.io-index"
469
- checksum = "1054432bae2f14e0061e33d23402fbaa67a921d319d56adc6bcf887ddad1cbc2"
470
- dependencies = [
471
- "log",
472
- "markup5ever",
473
- ]
474
-
475
422
  [[package]]
476
423
  name = "http"
477
424
  version = "1.4.0"
@@ -508,7 +455,7 @@ dependencies = [
508
455
  [[package]]
509
456
  name = "http2"
510
457
  version = "0.5.12"
511
- source = "git+https://github.com/neverl805/http2#96c3c028b5ff75c2232d7fbb6683bda668810d26"
458
+ source = "git+https://github.com/neverl805/http2#8d10bd499fece86e15739f878e25e7aa9f0947b5"
512
459
  dependencies = [
513
460
  "atomic-waker",
514
461
  "bytes",
@@ -686,9 +633,9 @@ dependencies = [
686
633
 
687
634
  [[package]]
688
635
  name = "libc"
689
- version = "0.2.182"
636
+ version = "0.2.183"
690
637
  source = "registry+https://github.com/rust-lang/crates.io-index"
691
- checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112"
638
+ checksum = "b5b646652bf6661599e1da8901b3b9522896f01e736bad5f723fe7a3a27f899d"
692
639
 
693
640
  [[package]]
694
641
  name = "libloading"
@@ -715,12 +662,6 @@ dependencies = [
715
662
  "scopeguard",
716
663
  ]
717
664
 
718
- [[package]]
719
- name = "log"
720
- version = "0.4.29"
721
- source = "registry+https://github.com/rust-lang/crates.io-index"
722
- checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
723
-
724
665
  [[package]]
725
666
  name = "lru"
726
667
  version = "0.16.3"
@@ -730,17 +671,6 @@ dependencies = [
730
671
  "hashbrown",
731
672
  ]
732
673
 
733
- [[package]]
734
- name = "markup5ever"
735
- version = "0.38.0"
736
- source = "registry+https://github.com/rust-lang/crates.io-index"
737
- checksum = "8983d30f2915feeaaab2d6babdd6bc7e9ed1a00b66b5e6d74df19aa9c0e91862"
738
- dependencies = [
739
- "log",
740
- "tendril",
741
- "web_atoms",
742
- ]
743
-
744
674
  [[package]]
745
675
  name = "memchr"
746
676
  version = "2.8.0"
@@ -792,38 +722,23 @@ dependencies = [
792
722
 
793
723
  [[package]]
794
724
  name = "never_primp"
795
- version = "2.4.0"
725
+ version = "2.4.2"
796
726
  dependencies = [
797
727
  "anyhow",
798
728
  "cookie",
799
729
  "encoding_rs",
800
730
  "foldhash",
801
- "html2text",
802
731
  "http",
803
- "http-body-util",
804
732
  "indexmap",
805
733
  "mime",
806
- "pem",
807
734
  "pyo3",
808
- "pyo3-log",
809
735
  "pythonize",
810
736
  "serde_json",
811
- "serde_urlencoded",
812
- "thiserror 2.0.18",
813
737
  "tokio",
814
- "tokio-util",
815
- "tracing",
816
- "urlencoding",
817
738
  "wreq",
818
739
  "wreq-util",
819
740
  ]
820
741
 
821
- [[package]]
822
- name = "new_debug_unreachable"
823
- version = "1.0.6"
824
- source = "registry+https://github.com/rust-lang/crates.io-index"
825
- checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
826
-
827
742
  [[package]]
828
743
  name = "nom"
829
744
  version = "7.1.3"
@@ -880,61 +795,12 @@ dependencies = [
880
795
  "windows-link",
881
796
  ]
882
797
 
883
- [[package]]
884
- name = "pem"
885
- version = "3.0.6"
886
- source = "registry+https://github.com/rust-lang/crates.io-index"
887
- checksum = "1d30c53c26bc5b31a98cd02d20f25a7c8567146caf63ed593a9d87b2775291be"
888
- dependencies = [
889
- "base64",
890
- "serde_core",
891
- ]
892
-
893
798
  [[package]]
894
799
  name = "percent-encoding"
895
800
  version = "2.3.2"
896
801
  source = "registry+https://github.com/rust-lang/crates.io-index"
897
802
  checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220"
898
803
 
899
- [[package]]
900
- name = "phf"
901
- version = "0.13.1"
902
- source = "registry+https://github.com/rust-lang/crates.io-index"
903
- checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf"
904
- dependencies = [
905
- "phf_shared",
906
- "serde",
907
- ]
908
-
909
- [[package]]
910
- name = "phf_codegen"
911
- version = "0.13.1"
912
- source = "registry+https://github.com/rust-lang/crates.io-index"
913
- checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1"
914
- dependencies = [
915
- "phf_generator",
916
- "phf_shared",
917
- ]
918
-
919
- [[package]]
920
- name = "phf_generator"
921
- version = "0.13.1"
922
- source = "registry+https://github.com/rust-lang/crates.io-index"
923
- checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737"
924
- dependencies = [
925
- "fastrand",
926
- "phf_shared",
927
- ]
928
-
929
- [[package]]
930
- name = "phf_shared"
931
- version = "0.13.1"
932
- source = "registry+https://github.com/rust-lang/crates.io-index"
933
- checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266"
934
- dependencies = [
935
- "siphasher",
936
- ]
937
-
938
804
  [[package]]
939
805
  name = "pin-project-lite"
940
806
  version = "0.2.17"
@@ -968,12 +834,6 @@ version = "0.2.0"
968
834
  source = "registry+https://github.com/rust-lang/crates.io-index"
969
835
  checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
970
836
 
971
- [[package]]
972
- name = "precomputed-hash"
973
- version = "0.1.1"
974
- source = "registry+https://github.com/rust-lang/crates.io-index"
975
- checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
976
-
977
837
  [[package]]
978
838
  name = "proc-macro2"
979
839
  version = "1.0.106"
@@ -1019,17 +879,6 @@ dependencies = [
1019
879
  "pyo3-build-config",
1020
880
  ]
1021
881
 
1022
- [[package]]
1023
- name = "pyo3-log"
1024
- version = "0.13.3"
1025
- source = "registry+https://github.com/rust-lang/crates.io-index"
1026
- checksum = "26c2ec80932c5c3b2d4fbc578c9b56b2d4502098587edb8bef5b6bfcad43682e"
1027
- dependencies = [
1028
- "arc-swap",
1029
- "log",
1030
- "pyo3",
1031
- ]
1032
-
1033
882
  [[package]]
1034
883
  name = "pyo3-macros"
1035
884
  version = "0.28.2"
@@ -1209,28 +1058,12 @@ version = "1.3.0"
1209
1058
  source = "registry+https://github.com/rust-lang/crates.io-index"
1210
1059
  checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
1211
1060
 
1212
- [[package]]
1213
- name = "signal-hook-registry"
1214
- version = "1.4.8"
1215
- source = "registry+https://github.com/rust-lang/crates.io-index"
1216
- checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
1217
- dependencies = [
1218
- "errno",
1219
- "libc",
1220
- ]
1221
-
1222
1061
  [[package]]
1223
1062
  name = "simd-adler32"
1224
1063
  version = "0.3.8"
1225
1064
  source = "registry+https://github.com/rust-lang/crates.io-index"
1226
1065
  checksum = "e320a6c5ad31d271ad523dcf3ad13e2767ad8b1cb8f047f75a8aeaf8da139da2"
1227
1066
 
1228
- [[package]]
1229
- name = "siphasher"
1230
- version = "1.0.2"
1231
- source = "registry+https://github.com/rust-lang/crates.io-index"
1232
- checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e"
1233
-
1234
1067
  [[package]]
1235
1068
  name = "slab"
1236
1069
  version = "0.4.12"
@@ -1259,30 +1092,6 @@ version = "1.2.1"
1259
1092
  source = "registry+https://github.com/rust-lang/crates.io-index"
1260
1093
  checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
1261
1094
 
1262
- [[package]]
1263
- name = "string_cache"
1264
- version = "0.9.0"
1265
- source = "registry+https://github.com/rust-lang/crates.io-index"
1266
- checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901"
1267
- dependencies = [
1268
- "new_debug_unreachable",
1269
- "parking_lot",
1270
- "phf_shared",
1271
- "precomputed-hash",
1272
- ]
1273
-
1274
- [[package]]
1275
- name = "string_cache_codegen"
1276
- version = "0.6.1"
1277
- source = "registry+https://github.com/rust-lang/crates.io-index"
1278
- checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69"
1279
- dependencies = [
1280
- "phf_generator",
1281
- "phf_shared",
1282
- "proc-macro2",
1283
- "quote",
1284
- ]
1285
-
1286
1095
  [[package]]
1287
1096
  name = "strum"
1288
1097
  version = "0.27.2"
@@ -1338,32 +1147,13 @@ version = "0.13.5"
1338
1147
  source = "registry+https://github.com/rust-lang/crates.io-index"
1339
1148
  checksum = "adb6935a6f5c20170eeceb1a3835a49e12e19d792f6dd344ccc76a985ca5a6ca"
1340
1149
 
1341
- [[package]]
1342
- name = "tendril"
1343
- version = "0.5.0"
1344
- source = "registry+https://github.com/rust-lang/crates.io-index"
1345
- checksum = "c4790fc369d5a530f4b544b094e31388b9b3a37c0f4652ade4505945f5660d24"
1346
- dependencies = [
1347
- "new_debug_unreachable",
1348
- "utf-8",
1349
- ]
1350
-
1351
1150
  [[package]]
1352
1151
  name = "thiserror"
1353
1152
  version = "1.0.69"
1354
1153
  source = "registry+https://github.com/rust-lang/crates.io-index"
1355
1154
  checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
1356
1155
  dependencies = [
1357
- "thiserror-impl 1.0.69",
1358
- ]
1359
-
1360
- [[package]]
1361
- name = "thiserror"
1362
- version = "2.0.18"
1363
- source = "registry+https://github.com/rust-lang/crates.io-index"
1364
- checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
1365
- dependencies = [
1366
- "thiserror-impl 2.0.18",
1156
+ "thiserror-impl",
1367
1157
  ]
1368
1158
 
1369
1159
  [[package]]
@@ -1377,17 +1167,6 @@ dependencies = [
1377
1167
  "syn",
1378
1168
  ]
1379
1169
 
1380
- [[package]]
1381
- name = "thiserror-impl"
1382
- version = "2.0.18"
1383
- source = "registry+https://github.com/rust-lang/crates.io-index"
1384
- checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
1385
- dependencies = [
1386
- "proc-macro2",
1387
- "quote",
1388
- "syn",
1389
- ]
1390
-
1391
1170
  [[package]]
1392
1171
  name = "time"
1393
1172
  version = "0.3.47"
@@ -1438,35 +1217,21 @@ dependencies = [
1438
1217
  "bytes",
1439
1218
  "libc",
1440
1219
  "mio",
1441
- "parking_lot",
1442
1220
  "pin-project-lite",
1443
- "signal-hook-registry",
1444
1221
  "socket2",
1445
- "tokio-macros",
1446
1222
  "windows-sys",
1447
1223
  ]
1448
1224
 
1449
1225
  [[package]]
1450
1226
  name = "tokio-btls"
1451
- version = "0.5.3"
1227
+ version = "0.5.4"
1452
1228
  source = "registry+https://github.com/rust-lang/crates.io-index"
1453
- checksum = "4d38dab03d8724de19c5efede757125f7f5f3c68261066f6e28323751f7dc313"
1229
+ checksum = "9ee6a3cf11812d7bd88a33dfbe4b2de192269bd967697afc99e7cd899a162a15"
1454
1230
  dependencies = [
1455
1231
  "btls",
1456
1232
  "tokio",
1457
1233
  ]
1458
1234
 
1459
- [[package]]
1460
- name = "tokio-macros"
1461
- version = "2.6.1"
1462
- source = "registry+https://github.com/rust-lang/crates.io-index"
1463
- checksum = "5c55a2eff8b69ce66c84f85e1da1c233edc36ceb85a2058d11b0d6a3c7e7569c"
1464
- dependencies = [
1465
- "proc-macro2",
1466
- "quote",
1467
- "syn",
1468
- ]
1469
-
1470
1235
  [[package]]
1471
1236
  name = "tokio-socks"
1472
1237
  version = "0.5.2"
@@ -1475,7 +1240,7 @@ checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f"
1475
1240
  dependencies = [
1476
1241
  "either",
1477
1242
  "futures-util",
1478
- "thiserror 1.0.69",
1243
+ "thiserror",
1479
1244
  "tokio",
1480
1245
  ]
1481
1246
 
@@ -1539,38 +1304,6 @@ version = "0.3.3"
1539
1304
  source = "registry+https://github.com/rust-lang/crates.io-index"
1540
1305
  checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3"
1541
1306
 
1542
- [[package]]
1543
- name = "tracing"
1544
- version = "0.1.44"
1545
- source = "registry+https://github.com/rust-lang/crates.io-index"
1546
- checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
1547
- dependencies = [
1548
- "log",
1549
- "pin-project-lite",
1550
- "tracing-attributes",
1551
- "tracing-core",
1552
- ]
1553
-
1554
- [[package]]
1555
- name = "tracing-attributes"
1556
- version = "0.1.31"
1557
- source = "registry+https://github.com/rust-lang/crates.io-index"
1558
- checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
1559
- dependencies = [
1560
- "proc-macro2",
1561
- "quote",
1562
- "syn",
1563
- ]
1564
-
1565
- [[package]]
1566
- name = "tracing-core"
1567
- version = "0.1.36"
1568
- source = "registry+https://github.com/rust-lang/crates.io-index"
1569
- checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a"
1570
- dependencies = [
1571
- "once_cell",
1572
- ]
1573
-
1574
1307
  [[package]]
1575
1308
  name = "try-lock"
1576
1309
  version = "0.2.5"
@@ -1609,12 +1342,6 @@ version = "1.0.24"
1609
1342
  source = "registry+https://github.com/rust-lang/crates.io-index"
1610
1343
  checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"
1611
1344
 
1612
- [[package]]
1613
- name = "unicode-width"
1614
- version = "0.2.2"
1615
- source = "registry+https://github.com/rust-lang/crates.io-index"
1616
- checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
1617
-
1618
1345
  [[package]]
1619
1346
  name = "url"
1620
1347
  version = "2.5.8"
@@ -1627,18 +1354,6 @@ dependencies = [
1627
1354
  "serde",
1628
1355
  ]
1629
1356
 
1630
- [[package]]
1631
- name = "urlencoding"
1632
- version = "2.1.3"
1633
- source = "registry+https://github.com/rust-lang/crates.io-index"
1634
- checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
1635
-
1636
- [[package]]
1637
- name = "utf-8"
1638
- version = "0.7.6"
1639
- source = "registry+https://github.com/rust-lang/crates.io-index"
1640
- checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
1641
-
1642
1357
  [[package]]
1643
1358
  name = "utf8_iter"
1644
1359
  version = "1.0.4"
@@ -1675,18 +1390,6 @@ dependencies = [
1675
1390
  "wit-bindgen",
1676
1391
  ]
1677
1392
 
1678
- [[package]]
1679
- name = "web_atoms"
1680
- version = "0.2.3"
1681
- source = "registry+https://github.com/rust-lang/crates.io-index"
1682
- checksum = "57a9779e9f04d2ac1ce317aee707aa2f6b773afba7b931222bff6983843b1576"
1683
- dependencies = [
1684
- "phf",
1685
- "phf_codegen",
1686
- "string_cache",
1687
- "string_cache_codegen",
1688
- ]
1689
-
1690
1393
  [[package]]
1691
1394
  name = "webpki-root-certs"
1692
1395
  version = "1.0.6"
@@ -1742,7 +1445,7 @@ checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
1742
1445
  [[package]]
1743
1446
  name = "wreq"
1744
1447
  version = "6.0.0-rc.28"
1745
- source = "git+https://github.com/neverl805/wreq#fa881593d1a85912a4a0327cf03254d38139c9b5"
1448
+ source = "git+https://github.com/neverl805/wreq#7f260cc1aefef20bb3d118fe68d9141bf6e4f985"
1746
1449
  dependencies = [
1747
1450
  "brotli",
1748
1451
  "btls",
@@ -0,0 +1,58 @@
1
+ [package]
2
+ name = "never_primp"
3
+ version = "2.4.2"
4
+ edition = "2024"
5
+ description = "基于原primp 用rust重构优化的python高效请求库"
6
+ authors = ["Neverland"]
7
+ readme = "README.md"
8
+
9
+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
10
+ [lib]
11
+ name = "never_primp"
12
+ crate-type = ["cdylib"]
13
+
14
+ [dependencies]
15
+ pyo3 = { version = "0.28.2", features = ["extension-module", "abi3-py39", "indexmap", "anyhow", "multiple-pymethods"] }
16
+ anyhow = "1.0.98"
17
+
18
+ # CI/Release: git 版本(构建时通过 MATURIN_GIT_TOKEN 鉴权)
19
+ wreq = { git = "https://github.com/neverl805/wreq", features = [
20
+ #wreq = { path = "/Users/jiarongxu/PyCharmMiscProject/my_github/wreq", features = [
21
+ "json",
22
+ "cookies",
23
+ "socks",
24
+ "gzip",
25
+ "brotli",
26
+ "zstd",
27
+ "deflate",
28
+ "multipart",
29
+ "stream",
30
+ "query", # For query() method
31
+ "form", # For form() method
32
+ ] }
33
+ #wreq-util = { path = "/Users/jiarongxu/PyCharmMiscProject/my_github/wreq-util", features = ["emulation-serde", "emulation-rand"] }
34
+ wreq-util = { git = "https://github.com/neverl805/wreq-util", features = ["emulation-serde", "emulation-rand"] }
35
+
36
+ encoding_rs = { version = "0.8.35" }
37
+ foldhash = "0.2.0"
38
+ indexmap = { version = "2.9.0", features = ["serde"] }
39
+ # 仅保留库实际使用的 tokio 特性,移除 "full" 以减小编译体积
40
+ # rt-multi-thread: runtime.rs 中 Builder::new_multi_thread()
41
+ # fs: client.rs 中 tokio::fs::read()(multipart 文件上传)
42
+ tokio = { version = "1.44.2", features = ["rt-multi-thread", "fs"] }
43
+
44
+ pythonize = "0.28.0"
45
+ serde_json = "1.0.140"
46
+
47
+ http = "1.4.0"
48
+ cookie = "0.18"
49
+ mime = "0.3.17"
50
+
51
+ [profile.release]
52
+ codegen-units = 1 # 单编译单元,最大化 LTO 跨模块优化
53
+ lto = "fat" # 全程序链接时优化,消除跨 crate 的死代码
54
+ opt-level = 3 # 最高优化级别
55
+ panic = "abort" # panic 直接 abort,消除 unwinding 代码
56
+ strip = "symbols" # 剥离符号表,减小二进制体积
57
+ debug = false # 不生成调试信息
58
+ overflow-checks = false # 关闭整数溢出检查(release 下约 5% 性能提升)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: never_primp
3
- Version: 2.4.0
3
+ Version: 2.4.2
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: Intended Audience :: Developers
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -48,8 +48,9 @@ cookies = {
48
48
  'sdfas':'ddd',
49
49
  'swqrttwe':'ddd'
50
50
  }
51
- session = never_primp.Client(impersonate='chrome_143',impersonate_os='windows')
52
- # res = session.get('https://tls.peet.ws/api/all',verify=False,headers=safari_headers,cookies=cookies)
51
+ session = never_primp.Client(impersonate='chrome_143',impersonate_os='windows',proxy='http://127.0.0.1:9000')
52
+ session.set_cookies('https://tls.peet.ws',cookies)
53
+ res = session.get('https://tls.peet.ws/api/all',verify=False,headers=chrome_headers)
53
54
 
54
55
 
55
56
  # res = session.get('https://47.113.101.23:4442/')
@@ -57,7 +58,7 @@ session = never_primp.Client(impersonate='chrome_143',impersonate_os='windows')
57
58
 
58
59
  # res = session.get('https://fanpa.weneedstudy.cn:8443/complexTest')
59
60
  # res = session.get('https://tls.browserleaks.com/')
60
- res = session.get('https://tls.tsvmp.com:38080/cbbiyhh',verify=False,headers=chrome_headers,cookies=cookies)
61
+ # res = session.get('https://tls.tsvmp.com:38080/cbbiyhh',verify=False,headers=chrome_headers,cookies=cookies)
61
62
  # res = session.get('https://tls.jsvmp.top:38080',split_cookie=True)
62
63
 
63
64
 
@@ -0,0 +1,39 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ import never_primp
4
+
5
+ def test_concurrent_requests():
6
+
7
+ session = never_primp.Client(impersonate='chrome_145')
8
+
9
+ chrome_headers = {
10
+ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36",
11
+ "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
12
+ "Accept-Encoding": "gzip, deflate, br, zstd",
13
+ "sec-ch-ua": "\"Chromium\";v=\"142\", \"Google Chrome\";v=\"142\", \"Not_A Brand\";v=\"99\"",
14
+ "sec-ch-ua-mobile": "?0",
15
+ "sec-ch-ua-platform": "\"Windows\"",
16
+ "upgrade-insecure-requests": "1",
17
+ "sec-fetch-site": "cross-site",
18
+ "sec-fetch-mode": "navigate",
19
+ "sec-fetch-user": "?1",
20
+ "sec-fetch-dest": "document",
21
+ "accept-language": "en,zh-CN;q=0.9,zh;q=0.8,zh-HK;q=0.7",
22
+ "priority": "u=0, i"
23
+ }
24
+ try:
25
+ response = session.get(f"https://www.ma2e.top:4445/", headers=chrome_headers)
26
+ print(response)
27
+ print(response.status_code)
28
+ print(response.text)
29
+ except :
30
+ print('========================')
31
+
32
+ response = session.get(f"https://www.ma2e.top:4445/", headers=chrome_headers, verify=False)
33
+ print(response)
34
+ print(response.status_code)
35
+ print(response.text)
36
+
37
+
38
+ if __name__ == "__main__":
39
+ test_concurrent_requests()
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "never_primp"
7
- version = "2.4.0"
7
+ version = "2.4.2"
8
8
  description = "基于原primp 用rust重构调整的python请求库 - The fastest python HTTP client that can impersonate web browsers"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
@@ -164,8 +164,12 @@ impl RClient {
164
164
  }
165
165
 
166
166
  // Cookie store - create Jar and pass to client
167
+ // compressed=true → single merged "Cookie: a=1; b=2" header (HTTP/1.1 style)
168
+ // compressed=false → separate "cookie: a=1" / "cookie: b=2" headers (HTTP/2 style)
169
+ // When split_cookies=true, use uncompressed so session-level cookies are also split.
167
170
  let cookie_jar = if cookie_store.unwrap_or(true) {
168
- let jar = Arc::new(wreq::cookie::Jar::new(true)); // compressed by default
171
+ let compressed = !split_cookies.unwrap_or(false);
172
+ let jar = Arc::new(wreq::cookie::Jar::new(compressed));
169
173
  client_builder = client_builder.cookie_provider(jar.clone());
170
174
  Some(jar)
171
175
  } else {
@@ -739,7 +743,7 @@ impl RClient {
739
743
  // Using OrigHeaderMap for precise header ordering (anti-detection)
740
744
  // Using HeaderMap for efficient header storage with insert (override) behavior
741
745
 
742
- use wreq::header::{HeaderMap, HeaderValue, OrigHeaderMap};
746
+ use wreq::header::{HeaderMap, HeaderValue, OrigHeaderMap, OrigHeaderName};
743
747
 
744
748
  // Step 1: Collect all user headers into a HeaderMap (insert = override, not append)
745
749
  let mut user_headermap = HeaderMap::new();
@@ -787,9 +791,39 @@ impl RClient {
787
791
  }
788
792
  }
789
793
 
790
- // Add cookie at the end if present
791
- if cookies.is_some() {
792
- orig_headers.insert("cookie".to_string());
794
+ // Add "cookie" to orig_headers for correct position control.
795
+ // Also include session-level split cookies (auto-injected by jar) so sort_headers
796
+ // can position them correctly even when no explicit cookies are passed.
797
+ let needs_cookie_in_orig = cookies.is_some() || effective_split_cookies == Some(true);
798
+ if needs_cookie_in_orig {
799
+ // Browser behavior (HTTP/2): split cookie headers appear *before* the
800
+ // "priority" header. If priority is currently last, rebuild orig_headers
801
+ // with cookie inserted immediately before it.
802
+ let last_is_priority = effective_split_cookies == Some(true)
803
+ && orig_headers
804
+ .iter()
805
+ .last()
806
+ .map(|(name, _)| name.as_str().eq_ignore_ascii_case("priority"))
807
+ .unwrap_or(false);
808
+
809
+ if last_is_priority {
810
+ // Collect all OrigHeaderName values preserving original casing
811
+ let all_orig: Vec<OrigHeaderName> = orig_headers
812
+ .iter()
813
+ .map(|(_, orig_name)| orig_name.clone())
814
+ .collect();
815
+ orig_headers = OrigHeaderMap::new();
816
+ // Re-insert all except the last (priority)
817
+ for orig_name in all_orig[..all_orig.len() - 1].iter() {
818
+ orig_headers.insert(orig_name.clone());
819
+ }
820
+ // Insert cookie before priority
821
+ orig_headers.insert("cookie".to_string());
822
+ // Re-insert priority (preserving original casing)
823
+ orig_headers.insert(all_orig.last().unwrap().clone());
824
+ } else {
825
+ orig_headers.insert("cookie".to_string());
826
+ }
793
827
  }
794
828
 
795
829
  // Step 4: Apply all user headers at once using insert (override) behavior
@@ -1,62 +0,0 @@
1
- [package]
2
- name = "never_primp"
3
- version = "2.4.0"
4
- edition = "2024"
5
- description = "基于原primp 用rust重构优化的python高效请求库"
6
- authors = ["Neverland"]
7
- readme = "README.md"
8
-
9
-
10
- # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
11
- [lib]
12
- name = "never_primp"
13
- crate-type = ["cdylib"]
14
-
15
- [dependencies]
16
- pyo3 = { version = "0.28.2", features = ["extension-module", "abi3-py38", "indexmap", "anyhow", "multiple-pymethods"] }
17
- anyhow = "1.0.98"
18
- thiserror = "2.0.9"
19
- pem = "3.0.4"
20
- tracing = { version = "0.1.41", features = ["log-always"] }
21
- pyo3-log = "0.13.3"
22
-
23
- # Local development path for wreq 6.0.0-rc.25+
24
- # cmake --build . --config Release
25
- #wreq = { path = "G:/myself_rust_p/wreq", features = [
26
- wreq = { git = "https://github.com/neverl805/wreq", features = [
27
- "json",
28
- "cookies",
29
- "socks",
30
- "gzip",
31
- "brotli",
32
- "zstd",
33
- "deflate",
34
- "multipart",
35
- "stream",
36
- "query", # For query() method
37
- "form", # For form() method
38
- ] }
39
- # Use git version of wreq-util temporarily until local version is updated
40
- wreq-util = { git = "https://github.com/neverl805/wreq-util", features = ["emulation-serde", "emulation-rand"] }
41
- #wreq-util = { path = "G:/myself_rust_p/wreq-util", features = ["emulation-serde", "emulation-rand"] }
42
- encoding_rs = { version = "0.8.35" }
43
- foldhash = "0.2.0"
44
- indexmap = { version = "2.9.0", features = ["serde"] }
45
- tokio = { version = "1.44.2", features = ["full"] }
46
- tokio-util = { version = "0.7.14", features = ["codec"] } # for multipart
47
- html2text = "0.16.0"
48
- pythonize = "0.28.0"
49
- serde_json = "1.0.140"
50
- serde_urlencoded = "0.7.1"
51
- urlencoding = "2.1.3"
52
- http-body-util = "0.1.3"
53
- http = "1.4.0"
54
- cookie = "0.18"
55
- mime = "0.3.17"
56
-
57
- [profile.release]
58
- codegen-units = 1
59
- lto = "fat"
60
- opt-level = 3
61
- panic = "abort"
62
- strip = "symbols"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes