qgustavor / mega

Unofficial JavaScript SDK for MEGA
https://mega.js.org/
MIT License
161 stars 43 forks source link

Update api.mjs #147

Closed Zachary-Rude closed 1 year ago

qgustavor commented 1 year ago

Why? If you are thinking "let the user decide when to use an user-agent and not set a default", then no, using an user-agent by default is in order to make debugging issues easier to MEGA admins since, unless the client defines one, issues cannot be traced to a client. MEGA even says in their documentation to not use clients that don't use their own code because they might have issues and they even cite an issue I reported to them of a third party client that used all zero encryption keys. How did they know what client had the bug? By the user-agent. That's why version 1 of MEGAJS uses a user-agent by default. If you got issues with that (like in Firefox) just set it to null.

Edit: I misread the code diff, you removed the entire user-agent code, not just the default user-agent selection code. No way, I will close this.