dscottboggs / mastodon-async

Mastodon Client for Rust
Other
34 stars 12 forks source link

get_home_timeline throws serde deserialization error about card::Card.author_url #129

Open abhin4v opened 1 year ago

abhin4v commented 1 year ago

This bug is present in the comb branch.

get_home_timeline returns a page of status::Status data that contains card::Card that has an author_url field of type Option<Url>. This causes serde to validate that the field value is an actual URL. However, this data comes from the oembed data of the linked web pages in posts, and hence may be invalid. For example, this post has the author URL set to a person's name.

So, either the validation should be relaxed to ignore invalid values present in the field, or the field type should be changed to String.

The same issue may be present for the provider_url and embed_url fields of the card::Card type as well.

dscottboggs commented 1 year ago

Thank you for reporting this, I'll fix it as soon as possible.