mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
lol dpi
This commit is contained in:
parent
6e445487b1
commit
d8ebcd0ef7
|
@ -915,7 +915,7 @@ class HttpCli(object):
|
||||||
except:
|
except:
|
||||||
raise Pebkac(422, "you POSTed invalid json")
|
raise Pebkac(422, "you POSTed invalid json")
|
||||||
|
|
||||||
# self.reply(b" DDoS Protection ", 503)
|
# self.reply(b" DD" + b"oS Protection ", 503)
|
||||||
# return True
|
# return True
|
||||||
|
|
||||||
if "srch" in self.uparam or "srch" in body:
|
if "srch" in self.uparam or "srch" in body:
|
||||||
|
|
|
@ -248,7 +248,7 @@ var Ls = {
|
||||||
"md_eshow": "cannot show ",
|
"md_eshow": "cannot show ",
|
||||||
|
|
||||||
"xhr403": "403: Access denied\n\ntry pressing F5, maybe you got logged out",
|
"xhr403": "403: Access denied\n\ntry pressing F5, maybe you got logged out",
|
||||||
"cf_ok": "sorry about that -- DDoS protection kicked in\n\nthings should resume in about 30 sec\n\nif nothing happens, hit F5 to reload the page",
|
"cf_ok": "sorry about that -- DD" + wah + "oS protection kicked in\n\nthings should resume in about 30 sec\n\nif nothing happens, hit F5 to reload the page",
|
||||||
"tl_xe1": "could not list subfolders:\n\nerror ",
|
"tl_xe1": "could not list subfolders:\n\nerror ",
|
||||||
"tl_xe2": "404: Folder not found",
|
"tl_xe2": "404: Folder not found",
|
||||||
"fl_xe1": "could not list files in folder:\n\nerror ",
|
"fl_xe1": "could not list files in folder:\n\nerror ",
|
||||||
|
|
|
@ -6,7 +6,8 @@ if (!window['console'])
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var is_touch = 'ontouchstart' in window,
|
var wah = '',
|
||||||
|
is_touch = 'ontouchstart' in window,
|
||||||
is_https = (window.location + '').indexOf('https:') === 0,
|
is_https = (window.location + '').indexOf('https:') === 0,
|
||||||
IPHONE = is_touch && /iPhone|iPad|iPod/i.test(navigator.userAgent),
|
IPHONE = is_touch && /iPhone|iPad|iPod/i.test(navigator.userAgent),
|
||||||
WINDOWS = navigator.platform ? navigator.platform == 'Win32' : /Windows/.test(navigator.userAgent);
|
WINDOWS = navigator.platform ? navigator.platform == 'Win32' : /Windows/.test(navigator.userAgent);
|
||||||
|
@ -1455,7 +1456,7 @@ var favico = (function () {
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
var cf_ddos_t = 0;
|
var cf_cha_t = 0;
|
||||||
function xhrchk(xhr, prefix, e404) {
|
function xhrchk(xhr, prefix, e404) {
|
||||||
if (xhr.status < 400 && xhr.status >= 200)
|
if (xhr.status < 400 && xhr.status >= 200)
|
||||||
return true;
|
return true;
|
||||||
|
@ -1469,13 +1470,13 @@ function xhrchk(xhr, prefix, e404) {
|
||||||
var errtxt = (xhr.response && xhr.response.err) || xhr.responseText,
|
var errtxt = (xhr.response && xhr.response.err) || xhr.responseText,
|
||||||
fun = toast.err;
|
fun = toast.err;
|
||||||
|
|
||||||
if (xhr.status == 503 && /\bDDoS [Pp]rotection|>Just a moment|#cf-bubbles|Checking your browser/.test(errtxt)) {
|
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)) {
|
||||||
var now = Date.now(), td = now - cf_ddos_t;
|
var now = Date.now(), td = now - cf_cha_t;
|
||||||
if (td < 15000)
|
if (td < 15000)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cf_ddos_t = now;
|
cf_cha_t = now;
|
||||||
errtxt = 'Cloudflare DDoS protection kicked in\n\n<strong>trying to fix it...</strong>';
|
errtxt = 'Cloudflare DD' + wah + 'oS protection kicked in\n\n<strong>trying to fix it...</strong>';
|
||||||
fun = toast.warn;
|
fun = toast.warn;
|
||||||
|
|
||||||
qsr('#cf_frame');
|
qsr('#cf_frame');
|
||||||
|
|
Loading…
Reference in a new issue