Drop authentication on interfaces endpoint.

pull/113/merge
Todd Persen 2013-12-02 15:29:49 -05:00
parent 5cd6e3bb75
commit 26ffb699db
1 changed files with 7 additions and 1 deletions

View File

@ -865,7 +865,7 @@ func (self *HttpServer) commonSetDbAdmin(w libhttp.ResponseWriter, r *libhttp.Re
}
func (self *HttpServer) listInterfaces(w libhttp.ResponseWriter, r *libhttp.Request) {
self.tryAsDbUserAndClusterAdmin(w, r, func(u common.User) (int, interface{}) {
statusCode, contentType, body := yieldUser(nil, func(u common.User) (int, interface{}) {
entries, err := ioutil.ReadDir(filepath.Join(self.adminAssetsDir, "interfaces"))
if err != nil {
@ -880,4 +880,10 @@ func (self *HttpServer) listInterfaces(w libhttp.ResponseWriter, r *libhttp.Requ
}
return libhttp.StatusOK, directories
})
w.Header().Add("content-type", contentType)
w.WriteHeader(statusCode)
if len(body) > 0 {
w.Write(body)
}
}