config_server_agent 0.3.6 → 0.3.7
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/config_server_agent.rb +5 -2
- data/lib/config_server_agent/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: 1a3e3808d15e83db93422a44e1c853e9e734fff991419c9b091398ec40da6bd4
|
4
|
+
data.tar.gz: d4b407b4cb7289809eed5c792e2631f7293dcfbd7c1bc8574712b6740a953c64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5660ec66ec50937970dd617c14e536eca6cdc05f676d62599ad1c92d4cd2564472794f76ad2dcca5e2c80df735965a0cd0a07fe2b837f1f01d18b3f160fd51aa
|
7
|
+
data.tar.gz: 2b50f65285399fde0581726d4f257fccefeb238ce803f882bec5cf6ecd60a4a79d29c22f23cd9e9989f2e6f22ff88981ce2595e47efbc6d620f0af8213d00719
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## 0.3.7
|
8
|
+
### Changed
|
9
|
+
- Fixed content-type handling
|
10
|
+
|
7
11
|
## 0.3.6
|
8
12
|
### Changed
|
9
13
|
- Better error handling
|
data/lib/config_server_agent.rb
CHANGED
@@ -114,10 +114,13 @@ class ConfigServerAgent
|
|
114
114
|
end
|
115
115
|
|
116
116
|
def process_response(response)
|
117
|
-
|
117
|
+
unless response['content-type'].start_with? 'application/json'
|
118
|
+
raise Error, "Unexpected content-type from server: #{response['content-type']}"
|
119
|
+
end
|
120
|
+
|
118
121
|
data = JSON.parse response.read_body
|
119
122
|
|
120
|
-
raise Error, "Config Server error: #{data['error']}" unless Net::HTTPSuccess
|
123
|
+
raise Error, "Config Server error: #{data['error']}" unless response.is_a? Net::HTTPSuccess
|
121
124
|
data
|
122
125
|
|
123
126
|
rescue JSON::ParserError
|