Use Content-Disposition: form-data when uploading media
"attachment" is only allowed in response headers
Request headers need "form-data"
This fixes the media upload when using a gotosocial server.
I initially reported this issue against gotosocial https://github.com/superseriousbusiness/gotosocial/issues/1944 and they believe that this is a bug in Tokodon. Also thats the only place in the code where you use attachment instead of form-data.
Another issue I'm not fixing here is that changing the avatar fails because tokodon sends Content-Disposition: form-data; name="avatar"
and gotosocial expects Content-Disposition: form-data; name="avatar"; filename="XXXXX"
. They decided that this is a gotosocial bug because filename
is optional here.