Skip to content

Fixed: ValidateHTTPRequest() rejecting local ip addr 127.0.0.1

Compare
Choose a tag to compare
@kambahr kambahr released this 01 Jan 22:46
· 8 commits to main since this release

ValidateHTTPRequest() was rejecting request if host was 127.0.0.1.
Default allowed hosts should be localhost, 127.0.0.1 and a per-defined one:

	// Host name
	rHost := strings.ToLower(strings.Split(r.Host, ":")[0])
	if c.Site.HostName != "" && rHost != c.Site.HostName && rHost != "localhost" && rHost != "127.0.0.1" {
		return false, http.StatusBadGateway
	}