From cc07b71f68e97516b5fe9512a31d5afb8b8972cd Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 11 Feb 2025 23:18:21 +0800 Subject: [PATCH] *.go: Remove extra TODOs --- handle_repo_commit.go | 1 - handle_repo_index.go | 1 - handle_repo_log.go | 3 +-- handle_repo_raw.go | 1 - handle_repo_tree.go | 1 - diff --git a/handle_repo_commit.go b/handle_repo_commit.go index 22d58ec8684d90f45b6d8f2e3ec3a0c16c609281..4bec9ddc99d8c9959131e8eefa12ae023421d547 100644 --- a/handle_repo_commit.go +++ b/handle_repo_commit.go @@ -16,7 +16,6 @@ } func handle_repo_commit(w http.ResponseWriter, r *http.Request) { data := make(map[string]any) - // TODO: Sanitize path values group_name, repo_name, commit_id_specified_string := r.PathValue("group_name"), r.PathValue("repo_name"), r.PathValue("commit_id") data["group_name"], data["repo_name"] = group_name, repo_name repo, err := open_git_repo(group_name, repo_name) diff --git a/handle_repo_index.go b/handle_repo_index.go index a5a6dc5bf0f36ea749c2aa8ec2725ccc6d0b92d4..da1933291c81337f0a27d104c79cd40b330deb7f 100644 --- a/handle_repo_index.go +++ b/handle_repo_index.go @@ -6,7 +6,6 @@ ) func handle_repo_index(w http.ResponseWriter, r *http.Request) { data := make(map[string]any) - // TODO: Sanitize path values group_name, repo_name := r.PathValue("group_name"), r.PathValue("repo_name") data["group_name"], data["repo_name"] = group_name, repo_name repo, err := open_git_repo(group_name, repo_name) diff --git a/handle_repo_log.go b/handle_repo_log.go index 6a2d8bb138a5b5ba0793b63b313e5c2a876259d9..62e0e4fba49665c9f5c414797b68d38515c64a50 100644 --- a/handle_repo_log.go +++ b/handle_repo_log.go @@ -6,10 +6,9 @@ "github.com/go-git/go-git/v5/plumbing" ) -// TODO: I probably shouldn't include *all* commitsh here... +// TODO: I probably shouldn't include *all* commits here... func handle_repo_log(w http.ResponseWriter, r *http.Request) { data := make(map[string]any) - // TODO: Sanitize path values group_name, repo_name, ref_name := r.PathValue("group_name"), r.PathValue("repo_name"), r.PathValue("ref") data["group_name"], data["repo_name"], data["ref"] = group_name, repo_name, ref_name repo, err := open_git_repo(group_name, repo_name) diff --git a/handle_repo_raw.go b/handle_repo_raw.go index d3ffe3e4aaf2cabc2dddb29fd9a7a782a8dea1fb..7ed384281b622fd4257edc6d67c310514aa0dc34 100644 --- a/handle_repo_raw.go +++ b/handle_repo_raw.go @@ -11,7 +11,6 @@ ) func handle_repo_raw(w http.ResponseWriter, r *http.Request) { data := make(map[string]any) - // TODO: Sanitize path values raw_path_spec := r.PathValue("rest") group_name, repo_name, path_spec := r.PathValue("group_name"), r.PathValue("repo_name"), strings.TrimSuffix(raw_path_spec, "/") diff --git a/handle_repo_tree.go b/handle_repo_tree.go index 824f5dfa129dc6eb74b9c4d6cea973bd0dcef36f..1d185989956bfde97821e5d59a8f49a783550f3f 100644 --- a/handle_repo_tree.go +++ b/handle_repo_tree.go @@ -16,7 +16,6 @@ ) func handle_repo_tree(w http.ResponseWriter, r *http.Request) { data := make(map[string]any) - // TODO: Sanitize path values raw_path_spec := r.PathValue("rest") group_name, repo_name, path_spec := r.PathValue("group_name"), r.PathValue("repo_name"), strings.TrimSuffix(raw_path_spec, "/") ref_type, ref_name, err := get_param_ref_and_type(r) -- 2.48.1