Moebits / soundcloud.ts

Wrapper for the Soundcloud API with typings
MIT License
61 stars 14 forks source link

Header check makes some endpoints fail to return data #58

Open PixelMelt opened 1 hour ago

PixelMelt commented 1 hour ago

https://github.com/Moebits/soundcloud.ts/blob/3c38636a315903ece4783fe2ad9740fbd84b22c1/API.ts#L62

This statement causes the following call to return an empty array rather then the artists songs

console.log(await soundcloud.users.tracks("gingaloid"))

My monkey patch is to replace it with

if (r.headers["content-type"].includes("application/json")) return r.body.json()

Thanks so much for this project!!!

shaunx777 commented 1 hour ago

Please do not try the recommended fix, this is written by a bad actor with malicious intent and using this fix may damage your hardware.