fix(api): 仅信任配置的反向代理转发客户端 IP (#39)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package config
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestLoadTrustedProxies(t *testing.T) {
|
||||
t.Setenv("OPENGOODS_TRUSTED_PROXIES", "10.0.0.0/8")
|
||||
if got := Load().TrustedProxies; got != "10.0.0.0/8" {
|
||||
t.Fatalf("TrustedProxies = %q, want %q", got, "10.0.0.0/8")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user