fix prev comment
This commit is contained in:
@@ -336,7 +336,7 @@ func (s *Rest) lastCommentsCtrl(w http.ResponseWriter, r *http.Request) {
|
||||
filterDeleted = append(filterDeleted, c)
|
||||
}
|
||||
|
||||
return encodeJSONWithHTML(comments)
|
||||
return encodeJSONWithHTML(filterDeleted)
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
@@ -425,6 +425,9 @@ func (s *Rest) configCtrl(w http.ResponseWriter, r *http.Request) {
|
||||
authNames = append(authNames, ap.Name)
|
||||
}
|
||||
cnf.Auth = authNames
|
||||
if s.Authenticator.Admins == nil { // prevent json serialization to nil
|
||||
s.Authenticator.Admins = []string{}
|
||||
}
|
||||
render.Status(r, http.StatusOK)
|
||||
render.JSON(w, r, cnf)
|
||||
}
|
||||
|
||||
@@ -487,8 +487,8 @@ func prep(t *testing.T) (srv *Rest, ts *httptest.Server) {
|
||||
}
|
||||
|
||||
func withBasicAuth(r *http.Request, username, password string) *http.Request {
|
||||
auth := username + ":" + password
|
||||
r.Header.Add("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(auth)))
|
||||
creds := username + ":" + password
|
||||
r.Header.Add("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(creds)))
|
||||
return r
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user