mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 03:17:04 +00:00
Prepare for custom child router(s) via plugin(s) for tomorrow
This commit is contained in:
18
http_test.go
18
http_test.go
@@ -103,6 +103,24 @@ func TestServerHostname(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestServerFullHost(t *testing.T) {
|
||||
var server1 Server
|
||||
var server2 Server
|
||||
server1.Config.ListeningAddr = "127.0.0.1:8080"
|
||||
server1.Config.CertFile = "notempty"
|
||||
server1.Config.KeyFile = "notempty"
|
||||
server2.Config.ListeningAddr = "127.0.0.1:8080"
|
||||
server1ExpectingFullhost := "https://" + server1.Config.ListeningAddr
|
||||
server2ExpectingFullhost := "http://" + server2.Config.ListeningAddr
|
||||
if server1.FullHost() != server1ExpectingFullhost {
|
||||
t.Fatalf("Expecting server 1's fullhost to be %s but got %s", server1ExpectingFullhost, server1.FullHost())
|
||||
}
|
||||
if server2.FullHost() != server2ExpectingFullhost {
|
||||
t.Fatalf("Expecting server 2's fullhost to be %s but got %s", server2ExpectingFullhost, server2.FullHost())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func TestServerPort(t *testing.T) {
|
||||
var server1, server2 Server
|
||||
expectedPort1 := 8080
|
||||
|
||||
Reference in New Issue
Block a user