From: Michael Tremer Date: Fri, 23 Feb 2024 19:25:00 +0000 (+0000) Subject: nopaste: Don't send HTML errors to cURL X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa86bd762425e3df6400c8b904c2121ef4c454d6;p=ipfire.org.git nopaste: Don't send HTML errors to cURL Signed-off-by: Michael Tremer --- diff --git a/src/web/nopaste.py b/src/web/nopaste.py index 6424f26e..ad013670 100644 --- a/src/web/nopaste.py +++ b/src/web/nopaste.py @@ -43,6 +43,13 @@ class CreateHandler(base.AnalyticsMixin, base.BaseHandler): # Perform the check as usual super().check_xsrf_cookie() + def write_error(self, *args, **kwargs): + if self.request.method == "PUT": + return + + # Write errors as usual + return super().write_error(*args, **kwargs) + @tornado.web.authenticated @base.ratelimit(minutes=15, requests=5) def put(self):