16 lines
516 B
Go
16 lines
516 B
Go
package transport
|
|
|
|
import "net/http"
|
|
|
|
// Looks are committed together with the name on initial join. Keep the old route
|
|
// explicit so a stale client cannot silently offer a free appearance change.
|
|
func (h *HTTP) appearanceRoutes(mux *http.ServeMux) {
|
|
mux.HandleFunc("POST /api/appearance", func(w http.ResponseWriter, r *http.Request) {
|
|
if _, err := h.auth.account(r); err != nil {
|
|
fail(w, 401, "sign in required")
|
|
return
|
|
}
|
|
fail(w, 403, "appearance can only be chosen when creating a character")
|
|
})
|
|
}
|