summaryrefslogtreecommitdiff
path: root/service/http/config_test.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-09-06 13:05:16 +0300
committerWolfy-J <[email protected]>2019-09-06 13:05:16 +0300
commit461db7f19195f70306e41e8920616c53eb00c1f3 (patch)
tree4f54e937e1a3cba255ff3a712cc7b55d6515aed7 /service/http/config_test.go
parent2ac01468ee745ace3a72742aa97cbd3e51d6dae2 (diff)
- bugfix: proper proxy IP validation + CS
Diffstat (limited to 'service/http/config_test.go')
-rw-r--r--service/http/config_test.go37
1 files changed, 0 insertions, 37 deletions
diff --git a/service/http/config_test.go b/service/http/config_test.go
index 800c87ce..d8b92247 100644
--- a/service/http/config_test.go
+++ b/service/http/config_test.go
@@ -83,43 +83,6 @@ func Test_Trusted_Subnets(t *testing.T) {
assert.False(t, cfg.IsTrusted("127.0.0.0.1"))
}
-func TestConfig_IsValid(t *testing.T) {
-
- cfg := &Config{
- Address: ":8080",
- MaxRequestSize: 1024,
- Uploads: &UploadsConfig{
- Dir: os.TempDir(),
- Forbid: []string{".go"},
- },
- HTTP2: &HTTP2Config{
- Enabled: true,
- },
- TrustedSubnets: []string{"200.1.0.0/16"},
- Workers: &roadrunner.ServerConfig{
- Command: "php tests/client.php echo pipes",
- Relay: "pipes",
- Pool: &roadrunner.Config{
- NumWorkers: 1,
- AllocateTimeout: time.Second,
- DestroyTimeout: time.Second,
- },
- },
- }
-
- ip6 := "FE80::0202:B3FF:FE1E:8329"
- ip4 := "127.0.0.1"
-
- assert.True(t, cfg.IsValid(ip4))
- assert.True(t, cfg.IsValid(ip6))
-
- ip4Invalid := "127.0.0.0.1"
- ip6Invalid := "FE80::0202::B3FF:FE1E:8329" // Can only use :: once in an address
-
- assert.False(t, cfg.IsValid(ip4Invalid))
- assert.False(t, cfg.IsValid(ip6Invalid))
-}
-
func Test_Trusted_Subnets_Err(t *testing.T) {
cfg := &Config{
Address: ":8080",