Skip to content

Commit

Permalink
secure some end points
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintWish committed Oct 9, 2024
1 parent a477ebe commit f133166
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,17 +199,22 @@ func Run(args []string) (error) {
})
})

r.Get("/ping", func(w http.ResponseWriter, r *http.Request) {
response.OK(w, true)
})
if flags.debug {
r.Get("/ping", func(w http.ResponseWriter, r *http.Request) {
response.OK(w, true)
})

r.Mount("/debug", cmw.Profiler())
}
})

// Let the game server know that's it's trying to use the old API.
router.Route(static.OldAPIVersion, func(r chi.Router) {
r.Route("/", func(r chi.Router) {
if !flags.debug {
r.Use(mw.InternalAuth)
}

r.Get("/sc/{hash}", con.DepreciatedAPIVersion)
r.Get("/ban/{steamid:[0-9]+}", con.DepreciatedAPIVersion)
r.Get("/map/{name}/{hash}", con.DepreciatedAPIVersion)
Expand Down

0 comments on commit f133166

Please sign in to comment.