mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-11 01:36:37 +08:00
fix lint
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
// Copyright 2026 Arctel.net
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// Package origin defines shared error messages for origin management.
|
||||
package origin
|
||||
|
||||
const (
|
||||
|
||||
@@ -12,6 +12,8 @@ import (
|
||||
"unicode"
|
||||
)
|
||||
|
||||
const maxOriginHostnameLength = 253
|
||||
|
||||
func normalizeOriginAddress(raw string) string {
|
||||
return strings.ToLower(strings.TrimSpace(raw))
|
||||
}
|
||||
@@ -29,7 +31,7 @@ func validateOriginAddress(address string) error {
|
||||
if ip := net.ParseIP(address); ip != nil {
|
||||
return nil
|
||||
}
|
||||
if len(address) > 253 {
|
||||
if len(address) > maxOriginHostnameLength {
|
||||
return errors.New(errOriginAddressInvalid)
|
||||
}
|
||||
labels := strings.Split(address, ".")
|
||||
|
||||
Reference in New Issue
Block a user