wreq 1.2.15-x86_64-linux → 1.3.0-x86_64-linux

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8ae0b2d5d1d90d689fe6eab9acfa27ee5d87551109846c25e87b49ada588018
4
- data.tar.gz: 5d08fd4163c512bfee5ed22c7948dd76e7022dae67bd98a71fdfb7080338fd96
3
+ metadata.gz: 11cb302df09d662922bf651bce01a4546d9837a0a3fbf72e91082389a12d0086
4
+ data.tar.gz: 2347b0838438abc24735ecfca4e3208fa803f664c4a949a8a008811120d7ea90
5
5
  SHA512:
6
- metadata.gz: 412a69d4ba6d3efe067cb3b37fcc6b0198b256170f7a898dbaa343f30d5939dcf2a38b958878ffb8aa0cb2809d7eacb9215b944867b66b679fc6db46ee511724
7
- data.tar.gz: 8ddf99a5fcc3e9961f21e10aa03c552e9e365c5eaf80d922c7ed2e431c16a296534499af3045188797439815bed07782ee70d2497dcc89e4c613325692b89e28
6
+ metadata.gz: 773b652ce75c1eeb3fb68c337b3bf742fae06e6c04670dee6f21a3cbeff87cfb3f458ba8086008786eece70977ab64b6ad7a132b08385f6d936279ff44f0c15b
7
+ data.tar.gz: b00383d4fe2b8bf1fa688117fbba851256bd1a1d227aa03f9c8ce793a918cbb5261d38f588f9ea55b4c64e5e2da318143a298322c4d7d274131958d49910f2a6
data/README.md CHANGED
@@ -91,7 +91,7 @@ Most browser device models share identical TLS and HTTP/2 configurations, differ
91
91
 
92
92
  | **Browser** | **Versions** |
93
93
  | ----------- | ------------ |
94
- | **Chrome** | `Chrome100`, `Chrome101`, `Chrome104`, `Chrome105`, `Chrome106`, `Chrome107`, `Chrome108`, `Chrome109`, `Chrome110`, `Chrome114`, `Chrome116`, `Chrome117`, `Chrome118`, `Chrome119`, `Chrome120`, `Chrome123`, `Chrome124`, `Chrome126`, `Chrome127`, `Chrome128`, `Chrome129`, `Chrome130`, `Chrome131`, `Chrome132`, `Chrome133`, `Chrome134`, `Chrome135`, `Chrome136`, `Chrome137`, `Chrome138`, `Chrome139`, `Chrome140`, `Chrome141`, `Chrome142`, `Chrome143`, `Chrome144`, `Chrome145`, `Chrome146`, `Chrome147`, `Chrome148`, `Chrome149`, `Chrome150`, `Chrome151`, `Chrome152`, `Chrome153` |
94
+ | **Chrome** | `Chrome100`, `Chrome101`, `Chrome104`, `Chrome105`, `Chrome106`, `Chrome107`, `Chrome108`, `Chrome109`, `Chrome110`, `Chrome114`, `Chrome116`, `Chrome117`, `Chrome118`, `Chrome119`, `Chrome120`, `Chrome123`, `Chrome124`, `Chrome126`, `Chrome127`, `Chrome128`, `Chrome129`, `Chrome130`, `Chrome131`, `Chrome132`, `Chrome133`, `Chrome134`, `Chrome135`, `Chrome136`, `Chrome137`, `Chrome138`, `Chrome139`, `Chrome140`, `Chrome141`, `Chrome142`, `Chrome143`, `Chrome144`, `Chrome145`, `Chrome146`, `Chrome147`, `Chrome148`, `Chrome149`, `Chrome150`, `Chrome151`, `Chrome152`, `Chrome153`, `Chrome154` |
95
95
  | **Edge** | `Edge101`, `Edge122`, `Edge127`, `Edge131`, `Edge134`, `Edge135`, `Edge136`, `Edge137`, `Edge138`, `Edge139`, `Edge140`, `Edge141`, `Edge142`, `Edge143`, `Edge144`, `Edge145`, `Edge146`, `Edge147`, `Edge148` |
96
96
  | **Firefox** | `Firefox109`, `Firefox117`, `Firefox128`, `Firefox133`, `Firefox135`, `FirefoxPrivate135`, `FirefoxAndroid135`, `Firefox136`, `FirefoxPrivate136`, `Firefox139`, `Firefox142`, `Firefox143`, `Firefox144`, `Firefox145`, `Firefox146`, `Firefox147`, `Firefox148`, `Firefox149`, `Firefox150`, `Firefox151`, `Firefox152` |
97
97
  | **Safari** | `Safari15_3`, `Safari15_5`, `Safari15_6_1`, `Safari16`, `Safari16_5`, `Safari17_0`, `Safari17_2_1`, `Safari17_4_1`, `Safari17_5`, `Safari17_6`, `Safari18`, `Safari18_2`, `Safari18_3`, `Safari18_3_1`, `Safari18_5`, `Safari26`, `Safari26_1`, `Safari26_2`, `SafariIos16_5`, `SafariIos17_2`, `SafariIos17_4_1`, `SafariIos18_1_1`, `SafariIos26`, `SafariIos26_2`, `SafariIPad18`, `SafariIPad26`, `SafariIpad26_2` |
@@ -12,10 +12,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12
12
  - *(emulate)* Add Chrome 151 profile.
13
13
  - *(emulate)* Add Chrome 152 profile.
14
14
  - *(emulate)* Add Chrome 153 profile.
15
+ - *(emulate)* Add Chrome 154 profile.
15
16
  - *(emulate)* Add Firefox 152 profile.
16
17
 
17
18
  ### Fixed
18
19
 
20
+ - Match Trust Anchor ID ordering by Chrome version: randomized per native configuration for 152/153, and sorted by raw ID bytes for 154.
21
+
19
22
  - *(emulate)* Fix Firefox 150 and 151 cipher suite lists.
20
23
 
21
24
  ## [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
Binary file
Binary file
Binary file
@@ -65,6 +65,7 @@ module Wreq
65
65
  Chrome151 = nil
66
66
  Chrome152 = nil
67
67
  Chrome153 = nil
68
+ Chrome154 = nil
68
69
 
69
70
  Edge101 = nil
70
71
  Edge122 = nil
@@ -263,6 +264,14 @@ module Wreq
263
264
  # for HTTP/2 and automatic default headers. The actual implementation is
264
265
  # provided by Rust.
265
266
  #
267
+ # Construction generates the native configuration once. For Chrome 152/153,
268
+ # the TLS trust_anchors extension's ID order is randomized at construction;
269
+ # Chrome 154 sorts those IDs by their raw bytes instead. Reusing this object
270
+ # across clients or requests retains that order. Creating a new object generates
271
+ # a new configuration, including a fresh shuffle for Chrome 152/153.
272
+ # This does not freeze other per-handshake randomness or force a new handshake
273
+ # when a request reuses an existing connection.
274
+ #
266
275
  # `profile:` defaults to the library's default profile when omitted.
267
276
  # `platform:` defaults to the library's default platform when omitted.
268
277
  #
@@ -288,6 +297,10 @@ module Wreq
288
297
  # Native fields and methods are set by the extension.
289
298
  # This stub is for documentation only.
290
299
  unless singleton_methods(false).include?(:new)
300
+ # Generates a reusable native configuration. Chrome 152/153 Trust Anchor ID
301
+ # order is chosen here and retained when this object is reused; Chrome 154
302
+ # uses raw-byte sorted order. See {Emulation} for connection semantics.
303
+ #
291
304
  # @param profile [Wreq::Profile, nil] Fingerprint profile to emulate
292
305
  # @param platform [Wreq::Platform, nil] Operating system platform to emulate
293
306
  # @param http2 [Boolean, nil] Whether HTTP/2 emulation is enabled; defaults
@@ -1,8 +1,28 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "test_helper"
4
+ require "socket"
5
+ require "stringio"
6
+ require "timeout"
4
7
 
5
8
  class EmulationTest < Minitest::Test
9
+ def test_reused_emulation_retains_trust_anchors_across_clients_and_requests
10
+ [Wreq::Profile::Chrome152, Wreq::Profile::Chrome153, Wreq::Profile::Chrome154].each do |profile|
11
+ emulation = Wreq::Emulation.new(profile: profile)
12
+ client = Wreq::Client.new(emulation: emulation, no_proxy: true)
13
+ expected = capture_trust_anchors { |url| client.get(url, timeout: 5) }
14
+ refute_empty expected, profile.to_s
15
+
16
+ request_client = Wreq::Client.new(no_proxy: true)
17
+ 2.times do
18
+ actual = capture_trust_anchors do |url|
19
+ request_client.get(url, emulation: emulation, timeout: 5)
20
+ end
21
+ assert_equal expected, actual, "#{profile}: reusing an object must retain its configuration"
22
+ end
23
+ end
24
+ end
25
+
6
26
  def test_all_emulation_device_constants_are_non_nil
7
27
  Wreq::Profile.constants.each do |name|
8
28
  const = Wreq::Profile.const_get(name)
@@ -22,6 +42,7 @@ class EmulationTest < Minitest::Test
22
42
  {
23
43
  Wreq::Profile::Chrome152 => "Chrome152",
24
44
  Wreq::Profile::Chrome153 => "Chrome153",
45
+ Wreq::Profile::Chrome154 => "Chrome154",
25
46
  Wreq::Profile::Firefox152 => "Firefox152"
26
47
  }.each do |profile, name|
27
48
  assert_equal name, profile.to_s
@@ -36,4 +57,60 @@ class EmulationTest < Minitest::Test
36
57
  "#{name} should be Platform, got #{const.inspect}"
37
58
  end
38
59
  end
60
+
61
+ private
62
+
63
+ # Each listener forces a new connection. Stop after ClientHello so this test
64
+ # inspects the extension bytes without depending on certificates or the network.
65
+ def capture_trust_anchors
66
+ server = TCPServer.new("127.0.0.1", 0)
67
+ thread = Thread.new do
68
+ socket = nil
69
+ Timeout.timeout(5) do
70
+ socket = server.accept
71
+ handshake = +"".b
72
+ loop do
73
+ header = read_tls_bytes(socket, 5)
74
+ raise "expected a TLS handshake record" unless header.getbyte(0) == 22
75
+ handshake << read_tls_bytes(socket, header.byteslice(3, 2).unpack1("n"))
76
+ next if handshake.bytesize < 4
77
+ length = handshake.byteslice(1, 3).bytes.reduce(0) { |n, byte| (n << 8) | byte }
78
+ break if handshake.bytesize >= length + 4
79
+ end
80
+ trust_anchors_from_client_hello(handshake)
81
+ end
82
+ ensure
83
+ socket&.close
84
+ end
85
+ thread.report_on_exception = false
86
+
87
+ assert_raises(Wreq::ConnectionError) { yield "https://127.0.0.1:#{server.addr[1]}/" }
88
+ thread.value
89
+ ensure
90
+ server&.close
91
+ thread&.kill if thread&.alive?
92
+ thread&.join
93
+ end
94
+
95
+ def read_tls_bytes(io, length)
96
+ bytes = io.read(length)
97
+ raise EOFError, "truncated ClientHello" unless bytes&.bytesize == length
98
+ bytes
99
+ end
100
+
101
+ def trust_anchors_from_client_hello(handshake)
102
+ io = StringIO.new(handshake)
103
+ raise "expected ClientHello" unless read_tls_bytes(io, 1).unpack1("C") == 1
104
+ read_tls_bytes(io, 3 + 2 + 32) # Handshake length, legacy version and random.
105
+ read_tls_bytes(io, read_tls_bytes(io, 1).unpack1("C")) # Session ID.
106
+ read_tls_bytes(io, read_tls_bytes(io, 2).unpack1("n")) # Cipher suites.
107
+ read_tls_bytes(io, read_tls_bytes(io, 1).unpack1("C")) # Compression methods.
108
+ extensions = StringIO.new(read_tls_bytes(io, read_tls_bytes(io, 2).unpack1("n")))
109
+ until extensions.eof?
110
+ type, length = read_tls_bytes(extensions, 4).unpack("nn")
111
+ data = read_tls_bytes(extensions, length)
112
+ return data if type == 51764
113
+ end
114
+ raise "missing trust_anchors extension"
115
+ end
39
116
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wreq
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.15
4
+ version: 1.3.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - SearchApi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-14 00:00:00.000000000 Z
11
+ date: 2026-09-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: An easy and powerful Ruby HTTP client with advanced browser fingerprinting
14
14
  that accurately emulates Chrome, Edge, Firefox, Safari, Opera, and OkHttp with precise