mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-29 18:22:32 -04:00
proxy: fix hyphen issue when parsing target
fix issue #948 Signed-off-by: Tw <tw19881113@gmail.com>
This commit is contained in:
@@ -111,6 +111,26 @@ func TestSetup(t *testing.T) {
|
||||
"http://localhost:8085": {},
|
||||
},
|
||||
},
|
||||
// test #10 test hyphen without port range
|
||||
{
|
||||
"proxy / http://localhost:8001/a--b",
|
||||
false,
|
||||
map[string]struct{}{
|
||||
"http://localhost:8001/a--b": {},
|
||||
},
|
||||
},
|
||||
// test #11 test hyphen with port range
|
||||
{
|
||||
"proxy / http://localhost:8001-8005/a--b",
|
||||
false,
|
||||
map[string]struct{}{
|
||||
"http://localhost:8001/a--b": {},
|
||||
"http://localhost:8002/a--b": {},
|
||||
"http://localhost:8003/a--b": {},
|
||||
"http://localhost:8004/a--b": {},
|
||||
"http://localhost:8005/a--b": {},
|
||||
},
|
||||
},
|
||||
} {
|
||||
c := caddy.NewTestController("http", test.input)
|
||||
err := setup(c)
|
||||
|
||||
Reference in New Issue
Block a user