log request path on synthetic 404
2 files changed, 25 insertions(+), 25 deletions(-)
changed files
M routes/git.go → routes/git.go
@@ -22,7 +22,7 @@ repo, err := d.GetCleanPath(repoName) if err != nil { log.Printf("getcleanpath error: %v", err) - return ErrNotFound + return d.NotFound(rc) } svc := rc.QueryArgs().Peek("service")@@ -51,7 +51,7 @@ repo, err := d.GetCleanPath(repoName) if err != nil { log.Printf("getcleanpath error: %v", err) - return ErrNotFound + return d.NotFound(rc) } rc.SetStatusCode(http.StatusOK)
M routes/routes.go → routes/routes.go
@@ -41,18 +41,18 @@ name, _ := rc.UserValue("name").(string) repoName := path.Join(category, name) if d.isNotAllowed(repoName) { - return ErrNotFound + return d.NotFound(rc) } path, err := d.GetCleanPath(repoName) if err != nil { log.Printf("getcleanpath error: %v", err) - return ErrNotFound + return d.NotFound(rc) } gr, err := git.Open(path, "") if err != nil { - return ErrNotFound + return d.NotFound(rc) } commits, err := gr.Commits()@@ -112,7 +112,7 @@ name, _ := rc.UserValue("name").(string) repoName := path.Join(category, name) if d.isNotAllowed(repoName) { - return ErrNotFound + return d.NotFound(rc) } rest, _ := rc.UserValue("rest").(string)@@ -123,7 +123,7 @@ path, err := d.GetCleanPath(repoName) if err != nil { log.Printf("getcleanpath error: %v", err) - return ErrNotFound + return d.NotFound(rc) } gr, err := git.Open(path, ref) if err != nil {@@ -159,7 +159,7 @@ name, _ := rc.UserValue("name").(string) repoName := path.Join(category, name) if d.isNotAllowed(repoName) { - return ErrNotFound + return d.NotFound(rc) } treePath := rc.UserValue("rest").(string) ref := rc.UserValue("ref").(string)@@ -168,12 +168,12 @@ path, err := d.GetCleanPath(repoName) if err != nil { log.Printf("getcleanpath error: %v", err) - return ErrNotFound + return d.NotFound(rc) } gr, err := git.Open(path, ref) if err != nil { - return ErrNotFound + return d.NotFound(rc) } contents, err := gr.FileContent(treePath)@@ -202,13 +202,13 @@ name, _ := rc.UserValue("name").(string) repoName := path.Join(category, name) if d.isNotAllowed(repoName) { - return ErrNotFound + return d.NotFound(rc) } file := rc.UserValue("file").(string) if !strings.HasSuffix(file, ".tar.gz") { - return ErrNotFound + return d.NotFound(rc) } ref := strings.TrimSuffix(file, ".tar.gz")@@ -222,12 +222,12 @@ path, err := d.GetCleanPath(repoName) if err != nil { log.Printf("getcleanpath error: %v", err) - return ErrNotFound + return d.NotFound(rc) } gr, err := git.Open(path, ref) if err != nil { - return ErrNotFound + return d.NotFound(rc) } gw := gzip.NewWriter(rc)@@ -264,7 +264,7 @@ name, _ := rc.UserValue("name").(string) repoName := path.Join(category, name) if d.isNotAllowed(repoName) { - return ErrNotFound + return d.NotFound(rc) } ref := rc.UserValue("ref").(string)@@ -272,12 +272,12 @@ path, err := d.GetCleanPath(repoName) if err != nil { log.Printf("getcleanpath error: %v", err) - return ErrNotFound + return d.NotFound(rc) } gr, err := git.Open(path, ref) if err != nil { - return ErrNotFound + return d.NotFound(rc) } commits, err := gr.Commits()@@ -305,7 +305,7 @@ name, _ := rc.UserValue("name").(string) repoName := path.Join(category, name) if d.isNotAllowed(repoName) { - return ErrNotFound + return d.NotFound(rc) } ref := rc.UserValue("ref").(string)@@ -313,11 +313,11 @@ path, err := d.GetCleanPath(repoName) if err != nil { log.Printf("getcleanpath error: %v", err) - return ErrNotFound + return d.NotFound(rc) } gr, err := git.Open(path, ref) if err != nil { - return ErrNotFound + return d.NotFound(rc) } diff, err := gr.Diff()@@ -347,7 +347,7 @@ name, _ := rc.UserValue("name").(string) repoName := path.Join(category, name) if d.isNotAllowed(repoName) { - return ErrNotFound + return d.NotFound(rc) } ref := rc.UserValue("ref").(string) filePath := strings.TrimSuffix(rc.UserValue("file").(string), "/")@@ -356,7 +356,7 @@ path, err := d.GetCleanPath(repoName) if err != nil { log.Printf("getcleanpath error: %v", err) - return ErrNotFound + return d.NotFound(rc) } g, err := git.Open(path, ref)@@ -390,7 +390,7 @@ name, _ := rc.UserValue("name").(string) repoName := path.Join(category, name) if d.isNotAllowed(repoName) { - return ErrNotFound + return d.NotFound(rc) } path, err := d.GetCleanPath(repoName)@@ -400,7 +400,7 @@ } gr, err := git.Open(path, "") if err != nil { - return ErrNotFound + return d.NotFound(rc) } tags, err := gr.Tags()@@ -427,7 +427,7 @@ return templates.RefsPage(pageData, branches, tags).Render(rc) } func (d *deps) NotFound(rc *atreugo.RequestCtx) error { - log.Printf("Not found: %s", rc.Request.URI().RequestURI()) + log.Printf("Not found: %s", rc.Request.RequestURI()) return ErrNotFound }