mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-16 15:17:14 +00:00
Update deps and simplify parsing
Bump frontend and Go dependencies, then modernize a few hot paths with newer Go string/range helpers. Also widen the client form quota/limit fields to improve the layout.
This commit is contained in:
@@ -18,7 +18,7 @@ func TestProbeRejectsOversizedStatusBody(t *testing.T) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_, _ = w.Write([]byte(`{"success":true,"obj":{"cpuPct":1,"panelVersion":"`))
|
||||
pad := strings.Repeat("x", 1<<20)
|
||||
for i := 0; i < 3; i++ {
|
||||
for range 3 {
|
||||
_, _ = w.Write([]byte(pad))
|
||||
}
|
||||
_, _ = w.Write([]byte(`"}}`))
|
||||
|
||||
@@ -2336,11 +2336,11 @@ func resolveGeofileTag(client *http.Client, latestURL string) (string, error) {
|
||||
// redirect target.
|
||||
func geofileTagFromLocation(location string) (string, error) {
|
||||
const marker = "/releases/download/"
|
||||
idx := strings.Index(location, marker)
|
||||
if idx < 0 {
|
||||
_, after, ok := strings.Cut(location, marker)
|
||||
if !ok {
|
||||
return "", common.NewErrorf("unexpected release redirect %q", location)
|
||||
}
|
||||
tag, _, found := strings.Cut(location[idx+len(marker):], "/")
|
||||
tag, _, found := strings.Cut(after, "/")
|
||||
if !found || tag == "" {
|
||||
return "", common.NewErrorf("unexpected release redirect %q", location)
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ func pageMessage(message string, limit int) []string {
|
||||
}
|
||||
|
||||
pages := make([]string, 0)
|
||||
for _, block := range strings.Split(message, "\r\n\r\n") {
|
||||
for block := range strings.SplitSeq(message, "\r\n\r\n") {
|
||||
for _, page := range splitMessageLines(block, limit) {
|
||||
last := len(pages) - 1
|
||||
if last >= 0 && len(pages[last])+len("\r\n\r\n")+len(page) <= limit {
|
||||
|
||||
Reference in New Issue
Block a user