From c2ace91e5283a9bc8cf630728e3eb73e4fb717de Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 29 Jan 2023 02:55:44 +0000 Subject: [PATCH] v1.6.0 --- README.md | 2 +- copyparty/__version__.py | 6 +++--- copyparty/httpcli.py | 14 ++++++-------- tests/util.py | 4 ++-- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 62f61ff7..e728163f 100644 --- a/README.md +++ b/README.md @@ -281,7 +281,7 @@ server-os-specific: upgrade notes -* `1.6.0` (2023-01-28): +* `1.6.0` (2023-01-29): * http-api: delete/move is now `POST` instead of `GET` * everything other than `GET` and `HEAD` must pass [cors validation](#cors) * `1.5.0` (2022-12-03): [new chunksize formula](https://github.com/9001/copyparty/commit/54e1c8d261df) for files larger than 128 GiB diff --git a/copyparty/__version__.py b/copyparty/__version__.py index 6718d386..afe976cc 100644 --- a/copyparty/__version__.py +++ b/copyparty/__version__.py @@ -1,8 +1,8 @@ # coding: utf-8 -VERSION = (1, 5, 6) -CODENAME = "babel" -BUILD_DT = (2023, 1, 12) +VERSION = (1, 6, 0) +CODENAME = "cors k" +BUILD_DT = (2023, 1, 29) S_VERSION = ".".join(map(str, VERSION)) S_BUILD_DT = "{0:04d}-{1:02d}-{2:02d}".format(*BUILD_DT) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 9bebb347..cee25d12 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -1204,15 +1204,7 @@ class HttpCli(object): if "raw" in self.uparam: return self.handle_stash(False) - if "delete" in self.uparam: - return self.handle_rm([]) - - if "move" in self.uparam: - return self.handle_mv() - ctype = self.headers.get("content-type", "").lower() - if not ctype: - raise Pebkac(400, "you can't post without a content-type header") if "multipart/form-data" in ctype: return self.handle_post_multipart() @@ -1224,6 +1216,12 @@ class HttpCli(object): ): return self.handle_post_json() + if "move" in self.uparam: + return self.handle_mv() + + if "delete" in self.uparam: + return self.handle_rm([]) + if "application/octet-stream" in ctype: return self.handle_post_binary() diff --git a/tests/util.py b/tests/util.py index 4519f81d..b0c2c05c 100644 --- a/tests/util.py +++ b/tests/util.py @@ -98,7 +98,7 @@ class Cfg(Namespace): def __init__(self, a=None, v=None, c=None): ka = {} - ex = "daw dav_inf dav_mac e2d e2ds e2dsa e2t e2ts e2tsr e2v e2vu e2vp ed emp force_js getmod hardlink ihead magic never_symlink nid nih no_acode no_athumb no_dav no_dedup no_del no_dupe no_logues no_mv no_readme no_robots no_scandir no_thumb no_vthumb no_zip nw xdev xlink xvol" + ex = "daw dav_inf dav_mac e2d e2ds e2dsa e2t e2ts e2tsr e2v e2vu e2vp ed emp force_js getmod hardlink ihead magic never_symlink nid nih no_acode no_athumb no_dav no_dedup no_del no_dupe no_logues no_mv no_readme no_robots no_sb_md no_sb_lg no_scandir no_thumb no_vthumb no_zip nw xdev xlink xvol" ka.update(**{k: False for k in ex.split()}) ex = "dotpart no_rescan no_sendfile no_voldump plain_ip" @@ -110,7 +110,7 @@ class Cfg(Namespace): ex = "df loris re_maxage rproxy rsp_slp s_wr_slp theme themes turbo" ka.update(**{k: 0 for k in ex.split()}) - ex = "doctitle favico html_head log_fk mth textfiles R RS SR" + ex = "doctitle favico html_head lg_sbf log_fk md_sbf mth textfiles R RS SR" ka.update(**{k: "" for k in ex.split()}) ex = "xad xar xau xbd xbr xbu xm"