mirror of
https://github.com/fatedier/frp.git
synced 2026-01-11 22:23:12 +00:00
support multilevel subdomain, fix #1132
This commit is contained in:
@@ -182,6 +182,21 @@ func TestHttp(t *testing.T) {
|
||||
assert.Equal("true", header.Get("X-Header-Set"))
|
||||
}
|
||||
|
||||
// wildcard_http
|
||||
// test.frp1.com match *.frp1.com
|
||||
code, body, _, err = util.SendHttpMsg("GET", fmt.Sprintf("http://127.0.0.1:%d", consts.TEST_HTTP_FRP_PORT), "test.frp1.com", nil, "")
|
||||
if assert.NoError(err) {
|
||||
assert.Equal(200, code)
|
||||
assert.Equal(consts.TEST_HTTP_NORMAL_STR, body)
|
||||
}
|
||||
|
||||
// new.test.frp1.com also match *.frp1.com
|
||||
code, body, _, err = util.SendHttpMsg("GET", fmt.Sprintf("http://127.0.0.1:%d", consts.TEST_HTTP_FRP_PORT), "new.test.frp1.com", nil, "")
|
||||
if assert.NoError(err) {
|
||||
assert.Equal(200, code)
|
||||
assert.Equal(consts.TEST_HTTP_NORMAL_STR, body)
|
||||
}
|
||||
|
||||
// subhost01
|
||||
code, body, _, err = util.SendHttpMsg("GET", fmt.Sprintf("http://127.0.0.1:%d", consts.TEST_HTTP_FRP_PORT), "test01.sub.com", nil, "")
|
||||
if assert.NoError(err) {
|
||||
|
||||
Reference in New Issue
Block a user