浏览代码

fix git clone error when repo has upper case name

codeskyblue 10 年之前
父节点
当前提交
db6c0ebf76
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      routers/repo/http.go

+ 1 - 0
routers/repo/http.go

@@ -227,6 +227,7 @@ var routes = []route{
 func HttpBackend(config *Config) http.HandlerFunc {
 	return func(w http.ResponseWriter, r *http.Request) {
 		for _, route := range routes {
+			r.URL.Path = strings.ToLower(r.URL.Path) // blue: In case some repo name has upper case name
 			if m := route.cr.FindStringSubmatch(r.URL.Path); m != nil {
 				if route.method != r.Method {
 					renderMethodNotAllowed(w, r)