From f727d5cb5a499d9117895b8e1e80c1a43ce8e18d Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 9 Aug 2022 09:00:22 +0200 Subject: [PATCH] new cloudflare memes, thx nh --- copyparty/httpcli.py | 2 +- copyparty/web/util.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 23497338..69595f2c 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -926,7 +926,7 @@ class HttpCli(object): except: raise Pebkac(422, "you POSTed invalid json") - # self.reply(b" DD" + b"oS Protection ", 503) + # self.reply(b"cloudflare", 503) # return True if "srch" in self.uparam or "srch" in body: diff --git a/copyparty/web/util.js b/copyparty/web/util.js index c93da5dc..fe9f3722 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -1533,13 +1533,13 @@ function xhrchk(xhr, prefix, e404) { var errtxt = (xhr.response && xhr.response.err) || xhr.responseText, fun = toast.err; - if (xhr.status == 503 && /\bDD(?:wah){0}[o]S [Pp]rote[c]tion|>Just a mo[m]ent|#cf-b[u]bbles|Chec[k]ing your br[o]wser/.test(errtxt)) { + if (xhr.status == 503 && /[Cc]loud[f]lare|>Just a mo[m]ent|#cf-b[u]bbles|Chec[k]ing your br[o]wser/.test(errtxt)) { var now = Date.now(), td = now - cf_cha_t; if (td < 15000) return; cf_cha_t = now; - errtxt = 'Cloudflare DD' + wah + 'oS protection kicked in\n\ntrying to fix it...'; + errtxt = 'Clou' + wah + 'dflare protection kicked in\n\ntrying to fix it...'; fun = toast.warn; qsr('#cf_frame');