mirror of
https://github.com/kataras/iris.git
synced 2025-12-19 10:57:05 +00:00
Rocket chat is on, Add Port() to the HTTPServer, disable subdomain persistence on subdomains when 127.0.0.1/0.0.0.0
I already made a test framework integration but I will commit this when I finish with the basic tests, we are going to final v3
This commit is contained in:
16
http.go
16
http.go
@@ -7,6 +7,7 @@ import (
|
||||
"net/http/pprof"
|
||||
"os"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
@@ -283,6 +284,21 @@ func (s *Server) Host() (host string) {
|
||||
|
||||
}
|
||||
|
||||
// Port returns the port which server listening for
|
||||
// if no port given with the ListeningAddr, it returns 80
|
||||
func (s *Server) Port() (port int) {
|
||||
a := s.Config.ListeningAddr
|
||||
if portIdx := strings.IndexByte(a, ':'); portIdx == 0 {
|
||||
p, err := strconv.Atoi(a[portIdx+1:])
|
||||
if err != nil {
|
||||
port = 80
|
||||
} else {
|
||||
port = p
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// VirtualHost returns the s.Config.ListeningAddr
|
||||
//
|
||||
func (s *Server) VirtualHost() (host string) {
|
||||
|
||||
Reference in New Issue
Block a user