icapps-translations 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/icapps/translations/http.rb +4 -3
- data/lib/icapps/translations/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7635101124fcfe93204d4b02cbcd565dd907d9e
|
4
|
+
data.tar.gz: a4750dc55164faff99aebb8fe87abe9b4b06872f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c866217c5104f2ba7e97400b9fcf38843529bd34a99e7a819e932a4708551df0cd9bd07de87056692d9f30334a7c235069b0fd1b06bed87f1440eb17b753123a
|
7
|
+
data.tar.gz: 4517265649ec71b85b126c5b05768802e21389749902cfbc33e836fa578e572323214fab4db220979f55d932b5dce564c3824ce8d59af49c32feeb79501b5ef1
|
@@ -8,14 +8,15 @@ module Icapps
|
|
8
8
|
class Http
|
9
9
|
class << self
|
10
10
|
def authenticated_response(path, is_json = false)
|
11
|
-
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
|
12
|
-
|
13
11
|
uri = URI("#{config.url}/#{path}")
|
14
12
|
puts "[VERBOSE] Connecting to url '#{uri}'.".colorize(:white) if options[:verbose]
|
15
13
|
|
16
14
|
http = Net::HTTP.new(uri.host, uri.port)
|
17
15
|
http.use_ssl = uri.scheme == 'https'
|
18
|
-
|
16
|
+
# Disable SSL for now.
|
17
|
+
ssl_context = OpenSSL::SSL::SSLContext.new
|
18
|
+
ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
19
|
+
request = Net::HTTP::Get.new(uri, ssl_context: ssl_context)
|
19
20
|
request.add_field 'Authorization', "Token token=#{config.project_key}"
|
20
21
|
response = http.request(request)
|
21
22
|
is_json ? JSON.parse(response.body) : response.body
|