diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-25 20:11:25 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-25 20:11:25 -0400 |
commit | 688ec6ecbdf0e1c450aa93fdc4d760c4ae63a73f (patch) | |
tree | 8adb59c369d1fe1bd41ae7be38785dc613a29a91 /routers/repo/http.go | |
parent | 87854c95a90cf1bebe1bffb833389471fb35f234 (diff) |
Fixed #209
Diffstat (limited to 'routers/repo/http.go')
-rw-r--r-- | routers/repo/http.go | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/routers/repo/http.go b/routers/repo/http.go index a6189ff2..f4cc00aa 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -22,8 +22,8 @@ import ( "github.com/go-martini/martini" "github.com/gogits/gogs/models" - "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/middleware" + "github.com/gogits/gogs/modules/setting" ) func Http(ctx *middleware.Context, params martini.Params) { @@ -59,7 +59,7 @@ func Http(ctx *middleware.Context, params martini.Params) { // only public pull don't need auth isPublicPull := !repo.IsPrivate && isPull - var askAuth = !isPublicPull || base.Service.RequireSignInView + var askAuth = !isPublicPull || setting.Service.RequireSignInView var authUser *models.User var authUsername, passwd string @@ -123,7 +123,7 @@ func Http(ctx *middleware.Context, params martini.Params) { } } - config := Config{base.RepoRootPath, "git", true, true, func(rpc string, input []byte) { + config := Config{setting.RepoRootPath, "git", true, true, func(rpc string, input []byte) { if rpc == "receive-pack" { firstLine := bytes.IndexRune(input, '\000') if firstLine > -1 { @@ -141,16 +141,6 @@ func Http(ctx *middleware.Context, params martini.Params) { handler := HttpBackend(&config) handler(ctx.ResponseWriter, ctx.Req) - - /* Webdav - dir := models.RepoPath(username, reponame) - - prefix := path.Join("/", username, params["reponame"]) - server := webdav.NewServer( - dir, prefix, true) - - server.ServeHTTP(ctx.ResponseWriter, ctx.Req) - */ } type route struct { @@ -483,14 +473,3 @@ func hdrCacheForever(w http.ResponseWriter) { w.Header().Set("Expires", fmt.Sprintf("%d", expires)) w.Header().Set("Cache-Control", "public, max-age=31536000") } - -// Main -/* -func main() { - http.HandleFunc("/", requestHandler()) - - err := http.ListenAndServe(":8080", nil) - if err != nil { - log.Fatal("ListenAndServe: ", err) - } -}*/ |