Skip to content

Resolve "Viewing a Flatpak app shows "Got unknown content type text/html from reviews.ubuntu.com""

I found that when gs_app_get_sources is done on a flatpak app the package name is app/org.gnome.Builder/x86_64/master, ubuntu-reviews was assuming that this name would be a string without any slashes (just the app name, eg with debs it appears to be just gnome-builder). This resulted in the URL being generated going to a strange place and receiving a 404 rather than an empty JSON file (which is what happens when the app doesn't exist).

The decision has been taken to disable ubuntu ratings and reviews for flatpak and snaps.

Original So I have put in a check which detects if there are slashes in the name, if there are four sections we assume it is flatpak and then extract the second part.

I'm not sure if this is what was expected from gs_app_get_sources, maybe another method should be used to determine the package name? Or if we can assume that four slashes is a flatpak (maybe we should check if the first part is "app" as well?). But this resolves the bug for me :-)

Also please note this is my first contribution, so I have probably done some things wrong ;-)

Closes #242 (closed)

Edited by Andrew Hayzen

Merge request reports