mirror of
https://github.com/dragonheim/gagent.git
synced 2025-04-25 04:08:59 -07:00
fix: changed db destination to programatic instead of hardcoded.
fix: minor cleanup. feat: cleaned up agent hint collection.
This commit is contained in:
parent
13d18d7714
commit
2b0975b30a
3 changed files with 16 additions and 9 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue