diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 28fd234b..5d2b101d 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -323,9 +323,7 @@ class HttpCli(object): if "." in pip else ":".join(pip.split(":")[:4]) + ":" ) + "0.0/16" - zs2 = ( - ' or "--xff-src=lan"' if self.conn.hsrv.xff_lan.map(pip) else "" - ) + zs2 = ' or "--xff-src=lan"' if self.conn.xff_lan.map(pip) else "" self.log(t % (self.args.xff_hdr, pip, cli_ip, zso, zs, zs2), 3) else: self.ip = cli_ip @@ -496,9 +494,7 @@ class HttpCli(object): else ":".join(pip.split(":")[:4]) + ":" ) + "0.0/16" zs2 = ( - ' or "--xff-src=lan"' - if self.conn.hsrv.xff_lan.map(pip) - else "" + ' or "--xff-src=lan"' if self.conn.xff_lan.map(pip) else "" ) self.log(t % (pip, idp_usr, idp_grp, zs, zs2), 3) diff --git a/copyparty/httpconn.py b/copyparty/httpconn.py index 543994ae..3e40f55a 100644 --- a/copyparty/httpconn.py +++ b/copyparty/httpconn.py @@ -55,8 +55,9 @@ class HttpConn(object): self.E: EnvParams = self.args.E self.asrv: AuthSrv = hsrv.asrv # mypy404 self.u2fh: Util.FHC = hsrv.u2fh # mypy404 - self.ipa_nm: NetMap = hsrv.ipa_nm - self.xff_nm: NetMap = hsrv.xff_nm + self.ipa_nm: Optional[NetMap] = hsrv.ipa_nm + self.xff_nm: Optional[NetMap] = hsrv.xff_nm + self.xff_lan: NetMap = hsrv.xff_lan # type: ignore self.iphash: HMaccas = hsrv.broker.iphash self.bans: dict[str, int] = hsrv.bans self.aclose: dict[str, int] = hsrv.aclose diff --git a/copyparty/httpsrv.py b/copyparty/httpsrv.py index fd0854df..1c6a8cca 100644 --- a/copyparty/httpsrv.py +++ b/copyparty/httpsrv.py @@ -104,7 +104,7 @@ class HttpSrv(object): self.t0 = time.time() nsuf = "-n{}-i{:x}".format(nid, os.getpid()) if nid else "" self.magician = Magician() - self.nm = NetMap([], {}) + self.nm = NetMap([], []) self.ssdp: Optional["SSDPr"] = None self.gpwd = Garda(self.args.ban_pw) self.g404 = Garda(self.args.ban_404) diff --git a/copyparty/tftpd.py b/copyparty/tftpd.py index 191a0793..86d06538 100644 --- a/copyparty/tftpd.py +++ b/copyparty/tftpd.py @@ -97,8 +97,6 @@ class Tftpd(object): cbak = [] if not self.args.tftp_no_fast and not EXE: try: - import inspect - ptn = re.compile(r"(^\s*)log\.debug\(.*\)$") for C in Cs: cbak.append(C.__dict__) diff --git a/tests/util.py b/tests/util.py index 0fd52c0a..e989e4f2 100644 --- a/tests/util.py +++ b/tests/util.py @@ -110,7 +110,7 @@ class Cfg(Namespace): def __init__(self, a=None, v=None, c=None, **ka0): ka = {} - ex = "daw dav_auth dav_inf dav_mac dav_rt e2d e2ds e2dsa e2t e2ts e2tsr e2v e2vu e2vp ed emp exp force_js getmod grid hardlink ih ihead magic never_symlink nid nih no_acode no_athumb no_dav no_dedup no_del no_dupe no_lifetime no_logues no_mv no_readme no_robots no_sb_md no_sb_lg no_scandir no_tarcmp no_thumb no_vthumb no_zip nrand nw q rand smb srch_dbg stats vague_403 vc ver xdev xlink xvol" + ex = "daw dav_auth dav_inf dav_mac dav_rt e2d e2ds e2dsa e2t e2ts e2tsr e2v e2vu e2vp early_ban ed emp exp force_js getmod grid hardlink ih ihead magic never_symlink nid nih no_acode no_athumb no_dav no_dedup no_del no_dupe no_lifetime no_logues no_mv no_readme no_robots no_sb_md no_sb_lg no_scandir no_tarcmp no_thumb no_vthumb no_zip nrand nw q rand smb srch_dbg stats vague_403 vc ver xdev xlink xvol" ka.update(**{k: False for k in ex.split()}) ex = "dotpart dotsrch no_dhash no_fastboot no_rescan no_sendfile no_voldump re_dhash plain_ip"