Skip to content

Commit

Permalink
Fix logic to parse JSON responses in Form wrapper (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ayushn21 authored Jan 4, 2025
1 parent 2caba2f commit 15244c1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/async/rest/wrapper/form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@ def prepare_request(request, payload)
end

def parser_for(response)
if content_type = response.headers["content-type"]
if parser = @content_types[content_type]
return parser
end
media_type, _ = response.headers["content-type"].split(";")
if media_type && parser = @content_types[media_type]
return parser
end

return super
Expand Down

0 comments on commit 15244c1

Please sign in to comment.