Feature: add dns query json api

This commit is contained in:
Dreamacro
2023-01-16 15:20:39 +08:00
committed by metacubex
parent 85db58aeb5
commit a6a72a5b54
5 changed files with 88 additions and 13 deletions

View File

@ -70,12 +70,10 @@ func getProxy(w http.ResponseWriter, r *http.Request) {
render.JSON(w, r, proxy)
}
type UpdateProxyRequest struct {
Name string `json:"name"`
}
func updateProxy(w http.ResponseWriter, r *http.Request) {
req := UpdateProxyRequest{}
req := struct {
Name string `json:"name"`
}{}
if err := render.DecodeJSON(r.Body, &req); err != nil {
render.Status(r, http.StatusBadRequest)
render.JSON(w, r, ErrBadRequest)