Skip to content
This repository has been archived by the owner on Mar 23, 2020. It is now read-only.

Uploading image attachments is broken #47

Closed
klausi opened this issue May 19, 2019 · 3 comments · Fixed by #48
Closed

Uploading image attachments is broken #47

klausi opened this issue May 19, 2019 · 3 comments · Fixed by #48

Comments

@klausi
Copy link
Contributor

klausi commented May 19, 2019

The upload photo example does not work with the mastodon.social server:

$ cargo run --example upload_photo
   Compiling mammut v0.12.0 (/home/klausi/workspace/Mammut)
    Finished dev [unoptimized + debuginfo] target(s) in 3.53s
     Running `target/debug/examples/upload_photo`
Enter the path to the photo you'd like to post: 
test.jpg
Error: Api(ApiError { error: None, error_description: None })

The response from the Mastodon server is:

{
  "id": "14765098",
  "type": "unknown",
  "url": "https://mastodon.social/files/original/missing.png",
  "preview_url": "https://mastodon.social/files/small/missing.png",
  "remote_url": null,
  "text_url": "https://mastodon.social/media/_X2BWQQcaR_gAi5SfYU",
  "meta": null,
  "description": null,
  "blurhash": null
}

Why does the server return an unknown type?
How do we tell the server that this is just a JPG image it should accept?

@klausi
Copy link
Contributor Author

klausi commented May 19, 2019

Further debugging revealed that this was broken by #46 . When I revert that change the upload works again.

How can we debug the requests that are being sent to see what the difference is?

@XAMPPRocky
Copy link
Owner

XAMPPRocky commented May 19, 2019

@klausi Thank you for your issue! I've gone ahead and added debug logging to requests. So if you now trigger debug level logging, mammut should should now print out the debug info of all requests and responses.

@klausi
Copy link
Contributor Author

klausi commented May 19, 2019

Thank you, managed to find the problem in the meantime, see #48

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants