Skip to content

Commit

Permalink
fix(allowed_host_validator.go): fix http prifix
Browse files Browse the repository at this point in the history
fix http prifix
  • Loading branch information
XdpCs committed Jan 19, 2024
1 parent 490f44d commit bdc0b56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion authentication/allowed_hosts_validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (v *AllowedHostsValidator) SetAllowedHostsErrorCheck(hosts []string) error
v.validHosts = make(map[string]bool, len(hosts))
if len(hosts) > 0 {
for _, host := range hosts {
if strings.HasPrefix(host, "http") {
if strings.HasPrefix(host, "http://") || strings.HasPrefix(host, "https://") {
return ErrInvalidHostPrefix
}
v.validHosts[strings.ToLower(host)] = true
Expand Down

0 comments on commit bdc0b56

Please sign in to comment.