diff --git a/README.PROTOCOL b/README.PROTOCOL index fa806f6..763a6a7 100644 --- a/README.PROTOCOL +++ b/README.PROTOCOL @@ -33,7 +33,7 @@ at which the group is found. This may be obtained either by explicit configuration by the user, or by parsing the `/public-groups.json` file which may contain an array of group statuses (see below). -A client then performs an HTTP GET request on the file `.status.json` at +A client then performs an HTTP GET request on the file `.status` at the group's location. This yields a single JSON object, which contains the following fields: @@ -158,7 +158,7 @@ The `username` field is the username that the server assigned to this user. The `permissions` field is an array of strings that may contain the values `present`, `op` and `record`. The `status` field is a dictionary that contains status information about the group, and updates the data -obtained from the `.status.json` URL described above. +obtained from the `.status` URL described above. ## Maintaining group membership diff --git a/static/galene.js b/static/galene.js index 2e7163a..e349fe9 100644 --- a/static/galene.js +++ b/static/galene.js @@ -3906,7 +3906,7 @@ async function serverConnect() { async function start() { try { - let r = await fetch(".status.json") + let r = await fetch(".status") if(!r.ok) throw new Error(`${r.status} ${r.statusText}`); groupStatus = await r.json() diff --git a/webserver/webserver.go b/webserver/webserver.go index 4105135..25ee307 100644 --- a/webserver/webserver.go +++ b/webserver/webserver.go @@ -318,10 +318,14 @@ func groupHandler(w http.ResponseWriter, r *http.Request) { return } - _, kind, rest := splitPath(r.URL.Path) - if kind == ".status.json" && rest == "" { + dir, kind, rest := splitPath(r.URL.Path) + if kind == ".status" && rest == "" { groupStatusHandler(w, r) return + } else if kind == ".status.json" && rest == "" { + http.Redirect(w, r, dir+"/"+".status", + http.StatusPermanentRedirect) + return } else if kind == ".whip" { if rest == "" { whipEndpointHandler(w, r) @@ -384,7 +388,7 @@ func groupBase(r *http.Request) (string, error) { func groupStatusHandler(w http.ResponseWriter, r *http.Request) { pth, kind, rest := splitPath(r.URL.Path) - if kind != ".status.json" || rest != "" { + if kind != ".status" || rest != "" { http.Error(w, "Internal server error", http.StatusInternalServerError) }