standard_id 0.14.0 → 0.14.1
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/standard_id/http_client.rb +9 -13
- data/lib/standard_id/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 980f1a28f34af1f7255514b5e09f7dc994d613673efb6e145827a6ddafe7fb5c
|
|
4
|
+
data.tar.gz: 4a663933f61433dc0236d4b2847c8005687a915a595dd00bc8dbfdc48084b40b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8b4871d0545f56edd61faa5d076219c2eef54dc65f5466987194c86b5a136fc013a55a9b836b8c7ad667e9f1ed510f8c65e8b4b69dfe8f9ba5f1b280fdcdad99
|
|
7
|
+
data.tar.gz: e890d50f439fcc48f0d741947b9e2674f83fbfc5701f1d159a0a3d8f70397f369f7af79a02d8b6484bd6869bbc553f1f8970a34cba3cdcced174e4bd7e379ac6
|
|
@@ -60,19 +60,15 @@ module StandardId
|
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
def start_connection(uri, resolved_ip: nil, &block)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
# Set Host header for virtual hosting when connecting to resolved IP
|
|
73
|
-
http.instance_variable_set(:@address, uri.host) if resolved_ip
|
|
74
|
-
yield http
|
|
75
|
-
end
|
|
63
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
64
|
+
http.use_ssl = (uri.scheme == "https")
|
|
65
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_PEER if http.use_ssl?
|
|
66
|
+
http.open_timeout = OPEN_TIMEOUT
|
|
67
|
+
http.read_timeout = READ_TIMEOUT
|
|
68
|
+
# Pin to the resolved IP for SSRF/DNS-rebinding protection while
|
|
69
|
+
# preserving the original hostname for TLS SNI and cert verification.
|
|
70
|
+
http.ipaddr = resolved_ip if resolved_ip
|
|
71
|
+
http.start(&block)
|
|
76
72
|
end
|
|
77
73
|
end
|
|
78
74
|
end
|
data/lib/standard_id/version.rb
CHANGED