Commit 2f72c13

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-05-30 16:36:10
fix(r2): fix content type for `text/plain`
1 parent ceaf970
Changed files (1)
src/database.py
@@ -235,7 +235,7 @@ async def set_cf_r2(
             upload = json.dumps(data, ensure_ascii=False).encode("utf-8")
         elif isinstance(data, str):
             upload = data.encode("utf-8")
-            payload["ContentType"] = "text/plain"
+            payload["ContentType"] = mime_type if mime_type.startswith("text") else "text/plain"
         payload |= {"Body": upload}
 
         if compress: