Fix overflow, diagram zoom, task-switch stall and other QA findings
This commit is contained in:
@@ -22,9 +22,9 @@ import (
|
||||
|
||||
func (s *Server) ConnectClient(w http.ResponseWriter, r *http.Request) {
|
||||
id := r.Header.Get("Byre-Client")
|
||||
host := r.Header.Get("Byre-Host")
|
||||
host := clientHost(r)
|
||||
if id == "" || host == "" {
|
||||
writeError(w, http.StatusBadRequest, errors.New("missing Byre-Client or Byre-Host"))
|
||||
writeError(w, http.StatusBadRequest, errors.New("missing Byre-Client or Byre-Host, or Byre-Host isn't percent-encoded"))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -40,9 +40,9 @@ func (s *Server) ConnectClient(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
func (s *Server) SetClientSync(w http.ResponseWriter, r *http.Request) {
|
||||
id := r.Header.Get("Byre-Client")
|
||||
host := r.Header.Get("Byre-Host")
|
||||
host := clientHost(r)
|
||||
if id == "" || host == "" {
|
||||
writeError(w, http.StatusBadRequest, errors.New("missing Byre-Client or Byre-Host"))
|
||||
writeError(w, http.StatusBadRequest, errors.New("missing Byre-Client or Byre-Host, or Byre-Host isn't percent-encoded"))
|
||||
return
|
||||
}
|
||||
sync := api.ClientSync{}
|
||||
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -202,11 +203,19 @@ func (s *Server) identify(next http.Handler) http.Handler {
|
||||
}
|
||||
|
||||
func (s *Server) acted(login string, r *http.Request) {
|
||||
if s.clients.Acted(r.Header.Get("Byre-Client"), login, r.Header.Get("Byre-Host"), r.Header.Get("Byre-Commit"), r.Header.Get("Byre-Build")) {
|
||||
if s.clients.Acted(r.Header.Get("Byre-Client"), login, clientHost(r), r.Header.Get("Byre-Commit"), r.Header.Get("Byre-Build")) {
|
||||
s.clientsChanged()
|
||||
}
|
||||
}
|
||||
|
||||
func clientHost(r *http.Request) string {
|
||||
host, err := url.PathUnescape(r.Header.Get("Byre-Host"))
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return host
|
||||
}
|
||||
|
||||
func (s *Server) connectedClients() []api.ConnectedClient {
|
||||
out := []api.ConnectedClient{}
|
||||
for _, c := range s.clients.List() {
|
||||
|
||||
Reference in New Issue
Block a user