Skip to content

Commit 15244c1

Browse files
authored
Fix logic to parse JSON responses in Form wrapper (#15)
1 parent 2caba2f commit 15244c1

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/async/rest/wrapper/form.rb

+3-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ def prepare_request(request, payload)
3434
end
3535

3636
def parser_for(response)
37-
if content_type = response.headers["content-type"]
38-
if parser = @content_types[content_type]
39-
return parser
40-
end
37+
media_type, _ = response.headers["content-type"].split(";")
38+
if media_type && parser = @content_types[media_type]
39+
return parser
4140
end
4241

4342
return super

0 commit comments

Comments
 (0)