Skip to content

Commit

Permalink
test(resolver) dashes in subdomain (#1565)
Browse files Browse the repository at this point in the history
  • Loading branch information
subnetmarco authored Aug 30, 2016
1 parent 185fc64 commit e1a8da0
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions spec/02-integration/05-proxy/01-resolver_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ describe("Resolver", function()
request_host = "wildcard.*",
upstream_url = "http://mockbin.com"
})
assert(helpers.dao.apis:insert {
request_host = "*.my-test.wildcard.com",
upstream_url = "http://mockbin.com"
})
assert(helpers.dao.apis:insert {
request_host = "*.my-test.another-wildcard.com",
upstream_url = "http://mockbin.com"
})
-- request_path
assert(helpers.dao.apis:insert {
request_path = "/status/200",
Expand Down Expand Up @@ -153,6 +161,26 @@ describe("Resolver", function()
})
assert.res_status(200, res)
end)
it("subdomain with dash", function()
local res = assert(client:send {
method = "GET",
path = "/status/200",
headers = {
["Host"] = "host.my-test.wildcard.com"
}
})
assert.res_status(200, res)
end)
it("another subdomain with dash", function()
local res = assert(client:send {
method = "GET",
path = "/status/200",
headers = {
["Host"] = "host.my-test.another-wildcard.com"
}
})
assert.res_status(200, res)
end)
it("TLD", function()
local res = assert(client:send {
method = "GET",
Expand Down

0 comments on commit e1a8da0

Please sign in to comment.