fix: changed db destination to programatic instead of hardcoded.

fix: minor cleanup.

feat: cleaned up agent hint collection.
This commit is contained in:
James Wells 2023-03-28 13:23:09 -07:00
parent 13d18d7714
commit 2b0975b30a
Signed by: jwells
GPG key ID: 73196D10B8E65666
3 changed files with 16 additions and 9 deletions

View file

@ -122,7 +122,6 @@ func createClientListener(wg *sync.WaitGroup, config gstructs.GagentConfig) {
}
log.Printf("[DEBUG] Client message received: %s", msg)
}
}
func unwrap(msg []string) (head string, tail []string) {
@ -137,9 +136,6 @@ func unwrap(msg []string) (head string, tail []string) {
func answerClient(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
/*
* fmt.Fprintf(w, "%v\n", r)
*/
http.NotFound(w, r)
return
}
@ -152,18 +148,21 @@ func answerClient(w http.ResponseWriter, r *http.Request) {
* Handle GET requests
*/
case http.MethodGet:
log.Println("[DEBUG] GET method received")
fmt.Fprintf(w, "%v\n", r)
/*
* Handle POST requests
*/
case http.MethodPost:
log.Println("[DEBUG] POST method received")
fmt.Fprintf(w, "%v\n", r)
/*
* Handle PUT requests
*/
case http.MethodOptions:
log.Println("[DEBUG] PUT method received")
w.Header().Set("Allow", "GET, POST, OPTIONS")
w.WriteHeader(http.StatusNoContent)