forked from mirror/serenity
Trim profileName suffix
This commit is contained in:
parent
8df5db256c
commit
c2f71a1d26
@ -4,6 +4,7 @@ import (
|
|||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
M "github.com/sagernet/serenity/common/metadata"
|
M "github.com/sagernet/serenity/common/metadata"
|
||||||
"github.com/sagernet/serenity/option"
|
"github.com/sagernet/serenity/option"
|
||||||
@ -31,6 +32,9 @@ func (s *Server) render(writer http.ResponseWriter, request *http.Request) {
|
|||||||
// compatibility with legacy versions
|
// compatibility with legacy versions
|
||||||
profileName = request.URL.Query().Get("profile")
|
profileName = request.URL.Query().Get("profile")
|
||||||
}
|
}
|
||||||
|
if strings.HasSuffix(profileName, "/") {
|
||||||
|
profileName = profileName[:len(profileName)-1]
|
||||||
|
}
|
||||||
var profile *Profile
|
var profile *Profile
|
||||||
if len(s.users) == 0 {
|
if len(s.users) == 0 {
|
||||||
if profileName == "" {
|
if profileName == "" {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user