From 4ce2acef395bc80b12f4d86956b0f2ca850e35d2 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sat, 20 Feb 2021 09:05:28 -0500 Subject: [PATCH] artifacts: disambiguate routes --- gitsrht/blueprints/artifacts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gitsrht/blueprints/artifacts.py b/gitsrht/blueprints/artifacts.py index 916f6ae..b35fb3f 100644 --- a/gitsrht/blueprints/artifacts.py +++ b/gitsrht/blueprints/artifacts.py @@ -22,7 +22,7 @@ s3_secret_key = cfg("objects", "s3-secret-key", default=None) s3_bucket = cfg("git.sr.ht", "s3-bucket", default=None) s3_prefix = cfg("git.sr.ht", "s3-prefix", default=None) -@artifacts.route("///refs//upload", methods=["POST"]) +@artifacts.route("///refs/upload/", methods=["POST"]) @loginrequired def ref_upload(owner, repo, ref): owner, repo = check_access(owner, repo, UserAccess.manage) @@ -56,7 +56,7 @@ def ref_upload(owner, repo, ref): repo=repo.name, ref=ref)) -@artifacts.route("///refs//") +@artifacts.route("///refs/download//") def ref_download(owner, repo, ref, filename): owner, repo = check_access(owner, repo, UserAccess.read) with GitRepository(repo.path) as git_repo: @@ -84,7 +84,7 @@ def ref_download(owner, repo, ref, filename): f = minio.get_object(s3_bucket, os.path.join(prefix, filename)) return send_file(f, as_attachment=True, attachment_filename=filename) -@artifacts.route("///refs//", methods=["POST"]) +@artifacts.route("///refs/delete//", methods=["POST"]) @loginrequired def ref_delete(owner, repo, ref, filename): owner, repo = check_access(owner, repo, UserAccess.manage) -- 2.38.4