diff options
author | Runxi Yu <me@runxiyu.org> | 2025-02-12 20:05:54 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-02-12 20:05:54 +0800 |
commit | 37aed1b98fb95d4dbbeb95b2ec487186fd04f404 (patch) | |
tree | 700eb3f21d5c311a96ef1bfea27e35f5436f05aa | |
parent | *.go: Reformat (diff) | |
download | forge-37aed1b98fb95d4dbbeb95b2ec487186fd04f404.tar.gz forge-37aed1b98fb95d4dbbeb95b2ec487186fd04f404.tar.zst forge-37aed1b98fb95d4dbbeb95b2ec487186fd04f404.zip |
repo_info: Warning to http cloners
Diffstat (limited to '')
-rw-r--r-- | handle_repo_info.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/handle_repo_info.go b/handle_repo_info.go new file mode 100644 index 0000000..4b01371 --- /dev/null +++ b/handle_repo_info.go @@ -0,0 +1,10 @@ +package main + +import ( + "net/http" + "net/url" +) + +func handle_repo_info(w http.ResponseWriter, r *http.Request, params map[string]string) { + http.Error(w, "\x1b[1;93mHi! We do not support Git operations over HTTP yet.\x1b[0m\n\x1b[1;93mMeanwhile, please use ssh by simply replacing the scheme with \"ssh://\":\x1b[0m\n\x1b[1;93mssh://" + r.Host + "/" + url.PathEscape(params["group_name"]) + "/:/repos/" + url.PathEscape(params["repo_name"]) + "\x1b[0m", http.StatusNotImplemented) +} |