jointakahe / takahe

An ActivityPub/Fediverse server
BSD 3-Clause "New" or "Revised" License
1.1k stars 84 forks source link

Do not canonicalise non json content in the search endpoint #654

Closed humrochagf closed 8 months ago

humrochagf commented 8 months ago

While testing https://phanpy.social/ web client I noticed it calls the search API with the links found in the posts to do some clever discovery magic.

But by doing so it makes the service to search for things that returns with 200 but are not json content, so we get some serialization crashes.

This checks for the response Content-Type before trying to do json parsing and canonicalization.

andrewgodwin commented 8 months ago

:+1: