summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-11-23 22:32:07 -0500
committerUnknwon <u@gogs.io>2015-11-23 22:32:07 -0500
commit0128036514ed40b2c878053e633762a8cffed74d (patch)
treeb268fd74611c9307bf0cd946ca7d804b6b265386 /routers
parentec8d41765d507e1f0b04ccf94dc934a0026498f2 (diff)
downloadgitea-0128036514ed40b2c878053e633762a8cffed74d.tar.gz
gitea-0128036514ed40b2c878053e633762a8cffed74d.zip
#1681 some fixes for builtin SSH server on Windows
Diffstat (limited to 'routers')
-rw-r--r--routers/install.go1
-rw-r--r--routers/repo/http.go6
2 files changed, 4 insertions, 3 deletions
diff --git a/routers/install.go b/routers/install.go
index 5240b88e33..f3c51d06ac 100644
--- a/routers/install.go
+++ b/routers/install.go
@@ -222,6 +222,7 @@ func InstallPost(ctx *middleware.Context, form auth.InstallForm) {
}
// Test repository root path.
+ form.RepoRootPath = strings.Replace(form.RepoRootPath, "\\", "/", -1)
if err := os.MkdirAll(form.RepoRootPath, os.ModePerm); err != nil {
ctx.Data["Err_RepoRootPath"] = true
ctx.RenderWithErr(ctx.Tr("install.invalid_repo_path", err), INSTALL, &form)
diff --git a/routers/repo/http.go b/routers/repo/http.go
index 214cc9ba39..7bc5f1aff6 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -84,13 +84,13 @@ func HTTP(ctx *middleware.Context) {
// check access
if askAuth {
- baHead := ctx.Req.Header.Get("Authorization")
- if baHead == "" {
+ authHead := ctx.Req.Header.Get("Authorization")
+ if len(authHead) == 0 {
authRequired(ctx)
return
}
- auths := strings.Fields(baHead)
+ auths := strings.Fields(authHead)
// currently check basic auth
// TODO: support digit auth
// FIXME: middlewares/context.go did basic auth check already,