mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-13 16:44:52 +08:00
fixing get config
This commit is contained in:
parent
cd37d7701b
commit
72e7f6bfde
1 changed files with 6 additions and 17 deletions
|
@ -48,9 +48,11 @@ func securityCheckServer(adminonly bool, next http.Handler) http.HandlerFunc {
|
|||
}
|
||||
if !adminonly && (err != nil || user == "") {
|
||||
returnErrorResponse(w, r, errorResponse)
|
||||
}
|
||||
if !isadmin && !authenticateMasterServer(authToken) {
|
||||
returnErrorResponse(w, r, errorResponse)
|
||||
return
|
||||
}
|
||||
if adminonly && !isadmin && !authenticateMasterServer(authToken) {
|
||||
returnErrorResponse(w, r, errorResponse)W
|
||||
return
|
||||
}
|
||||
next.ServeHTTP(w, r)
|
||||
}
|
||||
|
@ -88,23 +90,10 @@ func getConfig(w http.ResponseWriter, r *http.Request) {
|
|||
// get params
|
||||
|
||||
scfg := servercfg.GetServerConfig()
|
||||
w.WriteHeader(http.StatusOK)
|
||||
json.NewEncoder(w).Encode(scfg)
|
||||
//w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
|
||||
/*
|
||||
func getMongoConfig(w http.ResponseWriter, r *http.Request) {
|
||||
// Set header
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
// get params
|
||||
|
||||
mcfg := servercfg.GetMongoConfig()
|
||||
w.WriteHeader(http.StatusOK)
|
||||
json.NewEncoder(w).Encode(mcfg)
|
||||
}
|
||||
*/
|
||||
|
||||
func addNetwork(w http.ResponseWriter, r *http.Request) {
|
||||
// Set header
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
|
Loading…
Add table
Reference in a new issue