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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4adbb6b2c02be3d4a7b66d7c53b905229addf7ef
4
- data.tar.gz: 33f21952c24d20dbe44e4a40bc2ab884a9896f8d
3
+ metadata.gz: 4559d825ab0107a88621e834e5c295d22ea9bd1e
4
+ data.tar.gz: f81d8b69428f260fda5f923abf33e507ee4e4278
5
5
  SHA512:
6
- metadata.gz: b4c74b61c504b1aea0ee7727471adbf151d8a85e548268f4364b3f911e561783d58ff7ecf840d629b47a43c0d2fef25358717020e1393bb0466f4e43c8603742
7
- data.tar.gz: 59002048e6e93ab16efa7a516ec2880fde0567840577f1d1a6e0b2540413b61d8ae06f58d22591b29856d032e3818ac66991fb92cf2e856887e4ad0a57192135
6
+ metadata.gz: 772e63dbeb8a54759c2c5441d28f627c2281ffff57cd0a5a5735b6e5ef8ceec6fe82fb415eb15928ec7d9994e091de7c02c884694b61999591b1632f15473bc8
7
+ data.tar.gz: 1d9c9286ea07305fc39555b458b130480928d1425d4b3e18292845c6025c1f0c5ccdc311cba30e1a331865bcb471e43979c78cb2b0614028b7484d7c9e3c0463
@@ -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, use_ssl: true) do |http|
242
+ Net::HTTP.start(HOST, 443, https_options) do |http|
224
243
  response = http.request(req)
225
244
 
226
245
  case response.code
@@ -1,4 +1,4 @@
1
1
  module Censys
2
2
  # censys version
3
- VERSION = "0.1.3".freeze
3
+ VERSION = "0.1.4".freeze
4
4
  end
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.3
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-06 00:00:00.000000000 Z
11
+ date: 2018-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler