socialHub_httpUtility 1.0.3 → 1.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0a503d113f7f69e5e4c667166d99eaa4fd8799e1
4
- data.tar.gz: 35c8c82584776acb7a751fccc0b44f0722cc2f1c
3
+ metadata.gz: 2fcadcfdbb27ff7f26bbca324df713ab8a2a401e
4
+ data.tar.gz: 070607d48d947d9277dac99dc7b8a4f18f784354
5
5
  SHA512:
6
- metadata.gz: 43aa254f138cdc55bfac5ae0585f07b7bb88ba5cee5e850be53230c82eb378a2c523c514053885d07c2c9ca7bb954edb2e626b8b424531fe2a74faa43f467107
7
- data.tar.gz: c76e59171c4bd0686cfe2148ec65fbbb18a9b274f417a8b36e382fe6397674bfc410f2abd9f9e28066b26000a3466989611d099fa89ca42ef6a22f29a0d21f15
6
+ metadata.gz: cb1a9c63bb0561fe8feed48fee297002b31a306c02d470dbff6d2118ed9b2460bf51ddbc6f6a663bec107116ded84a3aef141c3e63b9847b099e404d72505b70
7
+ data.tar.gz: 8c1780e96133dc51eb5b444727177cb1a600dfaa7ec1f6fde84195202b720c646ab405612bd6d3885869e9f8b2463bef202cd441778b9978567f64f7fdce7ff7
@@ -4,9 +4,12 @@ module SocialHubHttpUtility
4
4
 
5
5
  def self.get_http_request(domain, path, params, headers, distination_service)
6
6
  url = domain+path
7
+ http_end_index = url.index(':')
8
+ http_type = url[0 , http_end_index]
7
9
  uri = URI.parse(url)
8
- uri.query = URI.encode_www_form( params )
10
+ uri.query = URI.encode_www_form( params)
9
11
  http = Net::HTTP.new(uri.host, uri.port)
12
+ http.use_ssl = (http_type == 'https')
10
13
  request = Net::HTTP::Get.new(uri.request_uri)
11
14
  headers.each do |key,value|
12
15
  request.add_field(key, value)
@@ -70,8 +73,11 @@ module SocialHubHttpUtility
70
73
 
71
74
  def self.post_http_request(domain, path, params, headers, distination_service)
72
75
  url = domain+path
76
+ http_end_index = url.index(':')
77
+ http_type = url[0 , http_end_index]
73
78
  uri = URI.parse(url)
74
79
  http = Net::HTTP.new(uri.host, uri.port)
80
+ http.use_ssl = (http_type == 'https')
75
81
  post_data = URI.encode_www_form(params)
76
82
  if(!headers.key?("request-id"))
77
83
  headers["request-id"] = SecureRandom.uuid
@@ -1,3 +1,3 @@
1
1
  module SocialHubHttpUtility
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socialHub_httpUtility
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - AbdAllah Elabasery
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-29 00:00:00.000000000 Z
11
+ date: 2017-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler