api_header_optimizer 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: d70771bd55e301295b8ea91d45ce8272ab7aee7240a59a356873eea37004f63e
4
- data.tar.gz: e883e11934321c8f62dd4cbc7cb128bdeff1b109f056fee1f92591f23d3acdd0
3
+ metadata.gz: a87ceb1aa38cc621dedcc2e2c72c5d06af166e58bd96939899e544ef00517d4b
4
+ data.tar.gz: 8491e6f127bebc4b3117c1ecacfea0ef5673933f65eb3f1ed2ea0accc4ecef39
5
5
  SHA512:
6
- metadata.gz: d95fda627e12c840fc4f33b1976cbf09d89bcada61086fdf71a4d750da204e4e03508413769582c492e605cf31a30109df0ff253a80618acd06b5e856a919415
7
- data.tar.gz: 5bdebb97c62b8c128a7640b367dc3344d1978b95b4e1f85951d72ecb2c446f7dcb878bf0d4a0c72d3ca6d58882acaaf61ddece304544e8f931acd6d95c1db1bf
6
+ metadata.gz: 2217d1708db46c38b0e9d17a8b21d48e2386ce4d8b2215a486c2f96b6e56dd9f41605a4add169dc60825cfd0c27b38c6ab2b5ec20d2a7c5810e5dd2473c2be8b
7
+ data.tar.gz: a576ddedead1b03922f0b0a696b83f44fd44593d32f98ff1a635a04bea1f8ea8f7cb121f54f033f7b5b12bab732804218794fdb6583820e3c79bdb2d2b4b362c
@@ -45,18 +45,15 @@ module ApiHeaderOptimizer
45
45
  def make_request(headers)
46
46
  http = Net::HTTP.new(@uri.host, @uri.port)
47
47
  http.use_ssl = @uri.scheme == 'https'
48
- http.start do |http|
49
- headers.each do |header_set|
50
- request = Net::HTTP::Get.new(@uri.path)
51
- header_set.each { |key, value| request[key] = value }
52
- begin
53
- response = http.request(request)
54
- return response if response.code.to_i.between?(200, 299) # Başarılı yanıtlar
55
- rescue => e
56
- puts "Request failed: #{e.message}"
57
- return nil
58
- end
59
- end
48
+ request = Net::HTTP::Get.new(@uri.path)
49
+ headers.each { |key, value| request[key] = value }
50
+
51
+ begin
52
+ response = http.request(request)
53
+ return response if response.code.to_i.between?(200, 299) # Başarılı yanıtlar
54
+ rescue StandardError => e
55
+ puts "Request failed: #{e.message}"
56
+ return nil
60
57
  end
61
58
  end
62
59
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ApiHeaderOptimizer
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: api_header_optimizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ziya Gökalp