You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Attempting to retrieve the content of files via the API doesn't work unless the files are in JSON format; you'll get a JSON::ParserError error, because get() in http.rb calls jsonparsel() which calls JSON.parse(response) for every request.
For example, when trying to retrieve an image so we can attach it via ActiveStorage in order to easily display it to the user:
Describe the bug
Attempting to retrieve the content of files via the API doesn't work unless the files are in
JSON
format; you'll get aJSON::ParserError
error, becauseget()
inhttp.rb
callsjsonparsel()
which callsJSON.parse(response)
for every request.For example, when trying to retrieve an image so we can attach it via ActiveStorage in order to easily display it to the user:
Simply returning the response if it's not JSON would resolve this.
To Reproduce
Steps to reproduce the behavior:
client.files.content(id: file_id)
Expected behavior
It should retrieve non-JSON content like generated PNGs successfully
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: