diff --git a/api/funkwhale_api/common/middleware.py b/api/funkwhale_api/common/middleware.py
index 7f82ae20c3168029564794f9b08f8a5347238d43..1143255e3d45bc8103ea7a11ec9a2d503798f0e4 100644
--- a/api/funkwhale_api/common/middleware.py
+++ b/api/funkwhale_api/common/middleware.py
@@ -101,8 +101,8 @@ def get_spa_file(spa_url, name):
         # strip the filename
         path = os.path.join(os.path.dirname(spa_url), name)
         # we try to open a local file
-        with open(path) as f:
-            return f.read()
+        with open(path, "rb") as f:
+            return f.read().decode("utf-8")
     cache_key = "spa-file:{}:{}".format(spa_url, name)
     cached = caches["local"].get(cache_key)
     if cached: