From 73fa70b41f182c7077332a3460364bf625c099d7 Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 27 Apr 2022 22:29:16 +0200 Subject: [PATCH] fix mostly-harmless xss --- copyparty/httpcli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 2f5ad171..d63ae562 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -349,8 +349,11 @@ class HttpCli(object): return body def loud_reply(self, body, *args, **kwargs): + if not kwargs.get("mime"): + kwargs["mime"] = "text/plain; charset=utf-8" + self.log(body.rstrip()) - self.reply(b"
" + body.encode("utf-8") + b"\r\n", *list(args), **kwargs)
+        self.reply(body.encode("utf-8") + b"\r\n", *list(args), **kwargs)
 
     def urlq(self, add, rm):
         """