1
0
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:
Makis Maropoulos
2016-07-03 16:21:57 +02:00
parent c443dc9808
commit 0d4b0ecd43
5 changed files with 37 additions and 7 deletions

16
http.go
View File

@@ -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) {