bixby-common 0.4.1 → 0.4.2
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/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/bixby-common.gemspec +1 -1
- data/lib/bixby-common/api/http_channel.rb +5 -6
- 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: 7a119f345c052270136e6030c530e24751441694
|
4
|
+
data.tar.gz: cc9419ce17828891dd41f4cd8b1f1cb49f36980a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03ed34519ed6ea1d1addf3909cb7a7deede4645fef80d1d982650324c1e8e02f7cfd316d9f08a1bb96d3bc83cded4d4581f8923d1b146de7a806b601517b3f9c
|
7
|
+
data.tar.gz: 130513bcc192be3679339be975b5b8a35681ae818cc5b1d9b154bafb9477c32d95954991fdcadc4eec8d6aceb08f5239bfa3ec7e0870e91bec0edb8bf2ea4426
|
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.2
|
data/bixby-common.gemspec
CHANGED
@@ -39,6 +39,11 @@ module Bixby
|
|
39
39
|
# @return [JsonResponse] response
|
40
40
|
def execute_internal(json_request, &block)
|
41
41
|
|
42
|
+
if json_request.respond_to?(:headers) then
|
43
|
+
# always required for posting to API
|
44
|
+
json_request.headers["Content-Type"] = "application/json"
|
45
|
+
end
|
46
|
+
|
42
47
|
req = HTTPI::Request.new(:url => @uri, :body => json_request.to_wire)
|
43
48
|
|
44
49
|
# add in extra headers if we have a SignedJsonRequest (or anything which has additional headers)
|
@@ -46,12 +51,6 @@ module Bixby
|
|
46
51
|
req.headers.merge!(json_request.headers)
|
47
52
|
end
|
48
53
|
|
49
|
-
if not req.headers.include? "Content-Type" then
|
50
|
-
# add content-type if not set
|
51
|
-
# may be set when creating a signed request
|
52
|
-
req.headers["Content-Type"] = "application/json"
|
53
|
-
end
|
54
|
-
|
55
54
|
if block then
|
56
55
|
# execute request with block
|
57
56
|
req.on_body(&block)
|