Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editMessage and editWebhookMessage send attachments twice in the same request #1356

Closed
TheEssem opened this issue Apr 1, 2022 · 1 comment · Fixed by #1285
Closed

editMessage and editWebhookMessage send attachments twice in the same request #1356

TheEssem opened this issue Apr 1, 2022 · 1 comment · Fixed by #1285
Labels

Comments

@TheEssem
Copy link

TheEssem commented Apr 1, 2022

When using Client#editMessage, Client#editWebhookMessage, or anything that depends on these functions (e.g. CommandInteraction#editOriginalMessage), the file key is not stripped from the input object. This results in attachments being sent over simultaneously in raw binary form via the file form data entry, and as a JSON array converted from a Node buffer in the payload_data entry:

image

This can result in requests that are much larger than they should be (e.g. a 4MB request being inflated to 16MB). It would probably be a good idea to remove file from the options object in RequestHandler#request if the file argument is also present.

@bsian03
Copy link
Collaborator

bsian03 commented Apr 12, 2022

#1285 resolves this

@bsian03 bsian03 linked a pull request Apr 12, 2022 that will close this issue
TheEssem added a commit to esmBot/eris that referenced this issue Jul 20, 2022
TheEssem added a commit to esmBot/eris that referenced this issue Aug 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants