Trim profileName suffix

This commit is contained in:
世界 2024-05-08 12:20:45 +08:00
parent 8df5db256c
commit c2f71a1d26
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4

View File

@ -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 == "" {