mirror of
https://github.com/elyby/chrly.git
synced 2024-12-27 23:40:30 +05:30
Удалён обработчик для запроса setSkin
This commit is contained in:
parent
1694403c79
commit
5d46094643
@ -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"))
|
|
||||||
}
|
|
@ -69,9 +69,6 @@ func main() {
|
|||||||
// 404
|
// 404
|
||||||
router.NotFoundHandler = http.HandlerFunc(routes.NotFound)
|
router.NotFoundHandler = http.HandlerFunc(routes.NotFound)
|
||||||
|
|
||||||
apiRouter := router.PathPrefix("/api").Subrouter()
|
|
||||||
apiRouter.HandleFunc("/user/{username}/skin", routes.SetSkin).Methods("POST")
|
|
||||||
|
|
||||||
services.Router = router
|
services.Router = router
|
||||||
services.RedisPool = redisPool
|
services.RedisPool = redisPool
|
||||||
services.RabbitMQChannel = rabbitChannel
|
services.RabbitMQChannel = rabbitChannel
|
||||||
|
Loading…
Reference in New Issue
Block a user