wreq 1.2.7-aarch64-linux → 1.2.8-aarch64-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 +4 -4
- data/lib/wreq_ruby/3.3/wreq_ruby.so +0 -0
- data/lib/wreq_ruby/3.4/wreq_ruby.so +0 -0
- data/lib/wreq_ruby/4.0/wreq_ruby.so +0 -0
- data/lib/wreq_ruby/error.rb +4 -0
- data/test/error_handling_test.rb +54 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: effa1ffca011ff19e80590cb18954b382b2dedd6df45f6cacc0379f37852f90f
|
|
4
|
+
data.tar.gz: 3d0ad5b022549f014eb3cc5cf9362c0de4ff0304e91c8fb510cd506434f6a519
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 289fb58adb1b18351e59de62efaf905ccb24e0851136821c0adf98de6fc2fbc352d41c0d42e9e07ec242867072a92005405e4de9c5efb575ec9432b89116f642
|
|
7
|
+
data.tar.gz: 01baebf652dbf56d58d084076d659a55cb5502041b3836a46b7ad580120fd63e4249db5f0c0ad172bb86d613dedb6b03a2fab8ea723c2bb1557fe9f579f28ef8
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/lib/wreq_ruby/error.rb
CHANGED
data/test/error_handling_test.rb
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
require "test_helper"
|
|
2
|
+
require "socket"
|
|
3
|
+
require "timeout"
|
|
2
4
|
|
|
3
5
|
class ErrorHandlingTest < Minitest::Test
|
|
6
|
+
def test_interrupt_error_stays_outside_standard_error
|
|
7
|
+
assert_equal Interrupt, Wreq::InterruptError.superclass
|
|
8
|
+
refute_operator Wreq::InterruptError, :<, StandardError
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def test_request_interruption_raises_interrupt_error
|
|
12
|
+
request_thread = nil
|
|
13
|
+
with_hanging_server do |url, accepted|
|
|
14
|
+
request_thread = Thread.new do
|
|
15
|
+
Wreq.get(url, timeout: 60)
|
|
16
|
+
rescue Interrupt, StandardError => error
|
|
17
|
+
error
|
|
18
|
+
end
|
|
19
|
+
request_thread.report_on_exception = false
|
|
20
|
+
|
|
21
|
+
Timeout.timeout(5) { accepted.pop }
|
|
22
|
+
request_thread.wakeup
|
|
23
|
+
|
|
24
|
+
assert request_thread.join(5), "Interrupted request thread should stop"
|
|
25
|
+
|
|
26
|
+
error = request_thread.value
|
|
27
|
+
assert_instance_of Wreq::InterruptError, error
|
|
28
|
+
refute_kind_of StandardError, error
|
|
29
|
+
end
|
|
30
|
+
ensure
|
|
31
|
+
request_thread&.kill
|
|
32
|
+
request_thread&.join(1)
|
|
33
|
+
end
|
|
34
|
+
|
|
4
35
|
def test_network_error_handling
|
|
5
36
|
# Try to connect to a non-existent domain
|
|
6
37
|
response = Wreq.get("https://definitely-not-a-real-domain-12345.com")
|
|
@@ -89,4 +120,27 @@ class ErrorHandlingTest < Minitest::Test
|
|
|
89
120
|
end
|
|
90
121
|
end
|
|
91
122
|
end
|
|
123
|
+
|
|
124
|
+
private
|
|
125
|
+
|
|
126
|
+
def with_hanging_server
|
|
127
|
+
server = TCPServer.new("127.0.0.1", 0)
|
|
128
|
+
accepted = Queue.new
|
|
129
|
+
thread = Thread.new do
|
|
130
|
+
socket = server.accept
|
|
131
|
+
accepted << true
|
|
132
|
+
sleep
|
|
133
|
+
rescue IOError, SystemCallError
|
|
134
|
+
nil
|
|
135
|
+
ensure
|
|
136
|
+
socket&.close unless socket&.closed?
|
|
137
|
+
end
|
|
138
|
+
thread.report_on_exception = false
|
|
139
|
+
|
|
140
|
+
yield "http://127.0.0.1:#{server.addr[1]}/", accepted
|
|
141
|
+
ensure
|
|
142
|
+
server&.close unless server&.closed?
|
|
143
|
+
thread&.kill
|
|
144
|
+
thread&.join(1)
|
|
145
|
+
end
|
|
92
146
|
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.
|
|
4
|
+
version: 1.2.8
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- SearchApi
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-07-
|
|
11
|
+
date: 2026-07-25 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
|