From c2f71a1d2697cbed2f63ef172f1e487fe3604b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 8 May 2024 12:20:45 +0800 Subject: [PATCH] Trim profileName suffix --- server/server_render.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/server_render.go b/server/server_render.go index 038ce5d..fe19e5f 100644 --- a/server/server_render.go +++ b/server/server_render.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/json" "net/http" + "strings" M "github.com/sagernet/serenity/common/metadata" "github.com/sagernet/serenity/option" @@ -31,6 +32,9 @@ func (s *Server) render(writer http.ResponseWriter, request *http.Request) { // compatibility with legacy versions profileName = request.URL.Query().Get("profile") } + if strings.HasSuffix(profileName, "/") { + profileName = profileName[:len(profileName)-1] + } var profile *Profile if len(s.users) == 0 { if profileName == "" {