remove unused

Signed-off-by: Jess Frazelle <acidburn@google.com>
This commit is contained in:
Jess Frazelle 2017-04-24 14:23:28 -04:00
parent e7825db8a0
commit 183c0d5ba3
No known key found for this signature in database
GPG key ID: 18F3685C0022BFF3
2 changed files with 2 additions and 28 deletions

View file

@ -82,33 +82,6 @@ func (rc *registryController) repositoriesHandler(w http.ResponseWriter, r *http
} }
} }
func (rc *registryController) tagHandler(w http.ResponseWriter, r *http.Request) {
log.WithFields(log.Fields{
"func": "tag",
"URL": r.URL,
"method": r.Method,
}).Info("fetching tag")
vars := mux.Vars(r)
repo := vars["repo"]
tag := vars["tag"]
if repo == "" {
w.WriteHeader(http.StatusNotFound)
fmt.Fprint(w, "Empty repo")
return
}
if tag == "" {
w.WriteHeader(http.StatusNotFound)
fmt.Fprint(w, "Empty tag")
return
}
fmt.Fprintf(w, "Repo: %s Tag: %s ", repo, tag)
return
}
func (rc *registryController) tagsHandler(w http.ResponseWriter, r *http.Request) { func (rc *registryController) tagsHandler(w http.ResponseWriter, r *http.Request) {
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"func": "tags", "func": "tags",

View file

@ -177,7 +177,8 @@ func main() {
staticHandler := http.FileServer(http.Dir(staticDir)) staticHandler := http.FileServer(http.Dir(staticDir))
mux.Handle("/static/", http.StripPrefix("/static/", staticHandler)) mux.Handle("/static/", http.StripPrefix("/static/", staticHandler))
mux.HandleFunc("/repo/{repo}", rc.tagsHandler) mux.HandleFunc("/repo/{repo}", rc.tagsHandler)
mux.HandleFunc("/repo/{repo}/{tag}", rc.tagHandler) mux.HandleFunc("/repo/{repo}/{tag}", rc.vulnerabilitiesHandler)
mux.HandleFunc("/repo/{repo}/{tag}/", rc.vulnerabilitiesHandler)
mux.HandleFunc("/repo/{repo}/{tag}/vulns", rc.vulnerabilitiesHandler) mux.HandleFunc("/repo/{repo}/{tag}/vulns", rc.vulnerabilitiesHandler)
mux.HandleFunc("/", rc.repositoriesHandler) mux.HandleFunc("/", rc.repositoriesHandler)