mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-03-21 17:44:58 -05:00
Correct MIMEType as well as handle no gamename
This commit is contained in:
parent
821ae1e537
commit
450d0fc979
|
|
@ -9,6 +9,8 @@ import (
|
|||
)
|
||||
|
||||
func HandleGroups(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
|
||||
u, err := url.Parse(r.URL.String())
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
@ -19,7 +21,8 @@ func HandleGroups(w http.ResponseWriter, r *http.Request) {
|
|||
panic(err)
|
||||
}
|
||||
|
||||
groups := qr2.GetGroups(append(query["gamename"], "")[0])
|
||||
gameName := query.Get("gamename")
|
||||
groups := qr2.GetGroups(gameName)
|
||||
|
||||
for _, group := range groups {
|
||||
for i, player := range group.Players {
|
||||
|
|
@ -42,7 +45,6 @@ func HandleGroups(w http.ResponseWriter, r *http.Request) {
|
|||
panic(err)
|
||||
}
|
||||
|
||||
w.Header().Set("Content-Type", "text/json")
|
||||
w.Header().Set("Content-Length", strconv.Itoa(len(jsonData)))
|
||||
w.Write(jsonData)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user