appwrite / sdk-for-web

[READ-ONLY] Official Appwrite Web SDK 🧡
https://appwrite.io
BSD 3-Clause "New" or "Revised" License
273 stars 59 forks source link

Unable to get browser avatar #11

Closed micschwarz closed 3 years ago

micschwarz commented 3 years ago

Hey,

I'm want to get some browser images for a profile overview. I noticed that the sdk does fetch the image with the incorrect content type (it uses "application/json" instead of "image/png").

Additionally the doc says that sdk.avatars.getBrowser(...) returns the image url, which is not correct. It returns the image content. Personaly I think it might be better to return the url, but thats just me :)

eldadfux commented 3 years ago

@micschwarz thanks for reporting this issue. This does seems like a bug. The correct behavior should be something like this method: https://github.com/appwrite/sdk-for-js/blob/master/src/sdk.js#L905

I'll work on a fix in the coming days.

eldadfux commented 3 years ago

@micschwarz sorry for the slight delay 😉 a new version of the Web SDK has been released (v1.2) with the following updates: