Skip to content

Commit 907d74a

Browse files
maxnussbaumgermanattanasio
authored andcommitted
fix(service json consumption): Fix where content_type param won't work with charset included
1 parent ce9bac1 commit 907d74a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/ibm_watson/personality_insights_v3.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def profile(content:, content_type:, accept: nil, content_language: nil, accept_
241241
"csv_headers" => csv_headers,
242242
"consumption_preferences" => consumption_preferences
243243
}
244-
if content_type == "application/json" && content.instance_of?(Hash)
244+
if content_type.start_with?("application/json") && content.instance_of?(Hash)
245245
data = content.to_json
246246
else
247247
data = content

lib/ibm_watson/tone_analyzer_v3.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def tone(tone_input:, content_type:, sentences: nil, tones: nil, content_languag
214214
"sentences" => sentences,
215215
"tones" => tones.to_a
216216
}
217-
if content_type == "application/json" && tone_input.instance_of?(Hash)
217+
if content_type.start_with?("application/json") && tone_input.instance_of?(Hash)
218218
data = tone_input.to_json
219219
else
220220
data = tone_input

0 commit comments

Comments
 (0)