MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / trimHost

Function trimHost

internal/serverapi/inbounds.go:445–461  ·  view source on GitHub ↗

trimHost 对 Host 的所有字符串字段做 TrimSpace,防止用户输入带入多余空格。

(h *inbounds.Host)

Source from the content-addressed store, hash-verified

443
444// trimHost 对 Host 的所有字符串字段做 TrimSpace,防止用户输入带入多余空格。
445func trimHost(h *inbounds.Host) {
446 h.Address = strings.TrimSpace(h.Address)
447 h.Remark = strings.TrimSpace(h.Remark)
448 h.SNI = strings.TrimSpace(h.SNI)
449 h.Host = strings.TrimSpace(h.Host)
450 h.Path = strings.TrimSpace(h.Path)
451 h.ALPN = strings.TrimSpace(h.ALPN)
452 h.Fingerprint = strings.TrimSpace(h.Fingerprint)
453 h.RealityPublicKey = strings.TrimSpace(h.RealityPublicKey)
454 h.RealityShortID = strings.TrimSpace(h.RealityShortID)
455 h.RealitySpiderX = strings.TrimSpace(h.RealitySpiderX)
456 h.Country = strings.TrimSpace(h.Country)
457 h.Region = strings.TrimSpace(h.Region)
458 h.Network = strings.TrimSpace(h.Network)
459 h.Entry = strings.TrimSpace(h.Entry)
460 h.Tags = strings.TrimSpace(h.Tags)
461}
462
463// triggerHostNodeSync 在 Host 保存后自动触发相关节点的 NodeGate sync:
464// 落地节点(https_port 影响 servers 端口)+ 前置节点(portforward 目标端口)。

Callers 2

handleHostsMethod · 0.85
handleHostRoutesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected