From 5d46094643fcdb00812670d82b55e49ee2889685 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Sat, 3 Dec 2016 02:08:00 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D1=91=D0=BD=20=D0=BE?= =?UTF-8?q?=D0=B1=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=87=D0=B8=D0=BA=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D0=B0=20set?= =?UTF-8?q?Skin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/SetSkin.go | 29 ----------------------------- minecraft-skinsystem.go | 3 --- 2 files changed, 32 deletions(-) delete mode 100644 lib/routes/SetSkin.go diff --git a/lib/routes/SetSkin.go b/lib/routes/SetSkin.go deleted file mode 100644 index b1acb87..0000000 --- a/lib/routes/SetSkin.go +++ /dev/null @@ -1,29 +0,0 @@ -package routes - -import ( - "net/http" - "strconv" - - "elyby/minecraft-skinsystem/lib/data" -) - -func SetSkin(w http.ResponseWriter, r *http.Request) { - key := r.Header.Get("X-Ely-key") - if key != "43fd2ce61b3f5704dfd729c1f2d6ffdb" { - w.WriteHeader(http.StatusForbidden) - w.Write([]byte("Nice try")) - return - } - - skin := new(data.SkinItem) - skin.Username = r.PostFormValue("username") - skin.UserId, _ = strconv.Atoi(r.PostFormValue("userId")) - skin.SkinId, _ = strconv.Atoi(r.PostFormValue("skinId")) - skin.Hash = r.PostFormValue("hash") - skin.Is1_8, _ = strconv.ParseBool(r.PostFormValue("is1_8")) - skin.IsSlim, _ = strconv.ParseBool(r.PostFormValue("isSlim")) - skin.Url = r.PostFormValue("url") - skin.Save() - - w.Write([]byte("OK")) -} diff --git a/minecraft-skinsystem.go b/minecraft-skinsystem.go index 9f90837..9aa1bc1 100644 --- a/minecraft-skinsystem.go +++ b/minecraft-skinsystem.go @@ -69,9 +69,6 @@ func main() { // 404 router.NotFoundHandler = http.HandlerFunc(routes.NotFound) - apiRouter := router.PathPrefix("/api").Subrouter() - apiRouter.HandleFunc("/user/{username}/skin", routes.SetSkin).Methods("POST") - services.Router = router services.RedisPool = redisPool services.RabbitMQChannel = rabbitChannel