ソースを参照

Plain text for GET / instead of malformed HTML

It's basically the same in browsers and looks nicer in tools that don't support HTML rendering (like curl).
Unrud 9 年 前
コミット
f875bcd892
1 ファイル変更1 行追加3 行削除
  1. 1 3
      radicale/__init__.py

+ 1 - 3
radicale/__init__.py

@@ -421,9 +421,7 @@ class Application:
         """Manage GET request."""
         # Display a "Radicale works!" message if the root URL is requested
         if not path.strip("/"):
-            headers = {"Content-type": "text/html"}
-            answer = "<!DOCTYPE html>\n<title>Radicale</title>Radicale works!"
-            return client.OK, headers, answer
+            return client.OK, {"Content-type": "text/plain"}, "Radicale works!"
         if not self._access(user, path, "r"):
             return NOT_ALLOWED
         with self.Collection.acquire_lock("r", user):