Enforce HTTP method on endpoints

pull/4/head
maru 8 months ago
parent 2adb70dd7e
commit 2656c0a033
No known key found for this signature in database
GPG Key ID: 37689350E9CD0F0D

@ -16,26 +16,26 @@ func Init(mux *http.ServeMux) {
daily.Init() daily.Init()
// account // account
mux.HandleFunc("/account/info", handleAccountInfo) mux.HandleFunc("GET /account/info", handleAccountInfo)
mux.HandleFunc("/account/register", handleAccountRegister) mux.HandleFunc("POST /account/register", handleAccountRegister)
mux.HandleFunc("/account/login", handleAccountLogin) mux.HandleFunc("POST /account/login", handleAccountLogin)
mux.HandleFunc("/account/logout", handleAccountLogout) mux.HandleFunc("GET /account/logout", handleAccountLogout)
// game // game
mux.HandleFunc("/game/playercount", handleGamePlayerCount) mux.HandleFunc("GET /game/playercount", handleGamePlayerCount)
mux.HandleFunc("/game/titlestats", handleGameTitleStats) mux.HandleFunc("GET /game/titlestats", handleGameTitleStats)
mux.HandleFunc("/game/classicsessioncount", handleGameClassicSessionCount) mux.HandleFunc("GET /game/classicsessioncount", handleGameClassicSessionCount)
// savedata // savedata
mux.HandleFunc("/savedata/get", handleSaveData) mux.HandleFunc("GET /savedata/get", handleSaveData)
mux.HandleFunc("/savedata/update", handleSaveData) mux.HandleFunc("POST /savedata/update", handleSaveData)
mux.HandleFunc("/savedata/delete", handleSaveData) mux.HandleFunc("GET /savedata/delete", handleSaveData)
mux.HandleFunc("/savedata/clear", handleSaveData) mux.HandleFunc("POST /savedata/clear", handleSaveData)
// daily // daily
mux.HandleFunc("/daily/seed", handleDailySeed) mux.HandleFunc("GET /daily/seed", handleDailySeed)
mux.HandleFunc("/daily/rankings", handleDailyRankings) mux.HandleFunc("GET /daily/rankings", handleDailyRankings)
mux.HandleFunc("/daily/rankingpagecount", handleDailyRankingPageCount) mux.HandleFunc("GET /daily/rankingpagecount", handleDailyRankingPageCount)
} }
func tokenFromRequest(r *http.Request) ([]byte, error) { func tokenFromRequest(r *http.Request) ([]byte, error) {

Loading…
Cancel
Save