censu 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/censys/api.rb +20 -1
- data/lib/censys/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4559d825ab0107a88621e834e5c295d22ea9bd1e
|
4
|
+
data.tar.gz: f81d8b69428f260fda5f923abf33e507ee4e4278
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 772e63dbeb8a54759c2c5441d28f627c2281ffff57cd0a5a5735b6e5ef8ceec6fe82fb415eb15928ec7d9994e091de7c02c884694b61999591b1632f15473bc8
|
7
|
+
data.tar.gz: 1d9c9286ea07305fc39555b458b130480928d1425d4b3e18292845c6025c1f0c5ccdc311cba30e1a331865bcb471e43979c78cb2b0614028b7484d7c9e3c0463
|
data/lib/censys/api.rb
CHANGED
@@ -203,6 +203,25 @@ module Censys
|
|
203
203
|
URI(URL + path)
|
204
204
|
end
|
205
205
|
|
206
|
+
#
|
207
|
+
# Return HTTPS options
|
208
|
+
#
|
209
|
+
# @return [Hash]
|
210
|
+
#
|
211
|
+
def https_options
|
212
|
+
if proxy = ENV["HTTPS_PROXY"]
|
213
|
+
uri = URI(proxy)
|
214
|
+
{
|
215
|
+
proxy_address: uri.hostname,
|
216
|
+
proxy_port: uri.port,
|
217
|
+
proxy_from_env: false,
|
218
|
+
use_ssl: true
|
219
|
+
}
|
220
|
+
else
|
221
|
+
{ use_ssl: true }
|
222
|
+
end
|
223
|
+
end
|
224
|
+
|
206
225
|
#
|
207
226
|
# Sends the HTTP request and handles the response.
|
208
227
|
#
|
@@ -220,7 +239,7 @@ module Censys
|
|
220
239
|
# raised.
|
221
240
|
#
|
222
241
|
def request(req)
|
223
|
-
Net::HTTP.start(HOST, 443,
|
242
|
+
Net::HTTP.start(HOST, 443, https_options) do |http|
|
224
243
|
response = http.request(req)
|
225
244
|
|
226
245
|
case response.code
|
data/lib/censys/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: censu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Manabu Niseki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|