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 +4 -4
- data/lib/api_header_optimizer/tester.rb +9 -12
- data/lib/api_header_optimizer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a87ceb1aa38cc621dedcc2e2c72c5d06af166e58bd96939899e544ef00517d4b
|
4
|
+
data.tar.gz: 8491e6f127bebc4b3117c1ecacfea0ef5673933f65eb3f1ed2ea0accc4ecef39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
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
|