mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-04-28 22:36:25 +02:00
Switch to Hostname() for checking whether a host is allowed or not (#238)
Using .Host allows you to get around an allowHosts or denyHosts entry by adding a port
This commit is contained in:
parent
f91e9cb508
commit
0da684b81e
2 changed files with 5 additions and 3 deletions
|
|
@ -170,9 +170,11 @@ func TestAllowed(t *testing.T) {
|
|||
|
||||
// deny requests that match denyHosts, even if signature is valid or also matches allowHosts
|
||||
{"http://test/image", emptyOptions, nil, []string{"test"}, nil, nil, nil, false},
|
||||
{"http://test:3000/image", emptyOptions, nil, []string{"test"}, nil, nil, nil, false},
|
||||
{"http://test/image", emptyOptions, []string{"test"}, []string{"test"}, nil, nil, nil, false},
|
||||
{"http://test/image", Options{Signature: "NDx5zZHx7QfE8E-ijowRreq6CJJBZjwiRfOVk_mkfQQ="}, nil, []string{"test"}, nil, key, nil, false},
|
||||
{"http://127.0.0.1/image", emptyOptions, nil, []string{"127.0.0.0/8"}, nil, nil, nil, false},
|
||||
{"http://127.0.0.1:3000/image", emptyOptions, nil, []string{"127.0.0.0/8"}, nil, nil, nil, false},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue