diff --git a/adapter/provider/parser.go b/adapter/provider/parser.go index edb6b911..39eff0ca 100644 --- a/adapter/provider/parser.go +++ b/adapter/provider/parser.go @@ -14,7 +14,7 @@ import ( ) var ( - errVehicleType = errors.New("unsupport vehicle type") + errVehicleType = errors.New("unsupported vehicle type") errSubPath = errors.New("path is not subpath of home directory") ) diff --git a/config/config.go b/config/config.go index 26518758..77b417e6 100644 --- a/config/config.go +++ b/config/config.go @@ -340,7 +340,7 @@ type RawSniffingConfig struct { type RawTLS struct { Certificate string `yaml:"certificate" json:"certificate"` PrivateKey string `yaml:"private-key" json:"private-key"` - CustomTrustCert []string `yaml:"custom-certifactes" json:"custom-certifactes"` + CustomTrustCert []string `yaml:"custom-certificates" json:"custom-certificates"` } type RawConfig struct { diff --git a/docs/config.yaml b/docs/config.yaml index 78e62d12..3b21b8f5 100644 --- a/docs/config.yaml +++ b/docs/config.yaml @@ -48,7 +48,7 @@ ipv6: true # 开启 IPv6 总开关,关闭阻断所有 IPv6 链接和屏蔽 DNS tls: certificate: string # 证书 PEM 格式,或者 证书的路径 private-key: string # 证书对应的私钥 PEM 格式,或者私钥路径 - custom-certifactes: + custom-certificates: - | -----BEGIN CERTIFICATE----- format/pem... diff --git a/hub/route/server.go b/hub/route/server.go index 1605b4bf..51e33e07 100644 --- a/hub/route/server.go +++ b/hub/route/server.go @@ -245,7 +245,7 @@ func setPrivateNetworkAccess(next http.Handler) http.Handler { }) } -func safeEuqal(a, b string) bool { +func safeEqual(a, b string) bool { aBuf := utils.ImmutableBytesFromString(a) bBuf := utils.ImmutableBytesFromString(b) return subtle.ConstantTimeCompare(aBuf, bBuf) == 1 @@ -257,7 +257,7 @@ func authentication(secret string) func(http.Handler) http.Handler { // Browser websocket not support custom header if r.Header.Get("Upgrade") == "websocket" && r.URL.Query().Get("token") != "" { token := r.URL.Query().Get("token") - if !safeEuqal(token, secret) { + if !safeEqual(token, secret) { render.Status(r, http.StatusUnauthorized) render.JSON(w, r, ErrUnauthorized) return @@ -270,7 +270,7 @@ func authentication(secret string) func(http.Handler) http.Handler { bearer, token, found := strings.Cut(header, " ") hasInvalidHeader := bearer != "Bearer" - hasInvalidSecret := !found || !safeEuqal(token, secret) + hasInvalidSecret := !found || !safeEqual(token, secret) if hasInvalidHeader || hasInvalidSecret { render.Status(r, http.StatusUnauthorized) render.JSON(w, r, ErrUnauthorized) diff --git a/listener/sing/sing.go b/listener/sing/sing.go index 10390e73..6e06bd01 100644 --- a/listener/sing/sing.go +++ b/listener/sing/sing.go @@ -224,7 +224,7 @@ func (c *packet) Data() []byte { return c.buff.Bytes() } -// WriteBack wirtes UDP packet with source(ip, port) = `addr` +// WriteBack writes UDP packet with source(ip, port) = `addr` func (c *packet) WriteBack(b []byte, addr net.Addr) (n int, err error) { if addr == nil { err = errors.New("address is invalid") diff --git a/transport/snell/snell.go b/transport/snell/snell.go index fe3e4ee0..f9cb4733 100644 --- a/transport/snell/snell.go +++ b/transport/snell/snell.go @@ -109,7 +109,7 @@ func WriteHeader(conn net.Conn, host string, port uint, version int) error { func WriteUDPHeader(conn net.Conn, version int) error { if version < Version3 { - return errors.New("unsupport UDP version") + return errors.New("unsupported UDP version") } // version, command, clientID length