1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-24 05:17:03 +00:00

Nothing special here - set the ability to set a virtual scheme for the server, used inside global tmpl helper funcs

This commit is contained in:
Gerasimos Maropoulos
2016-07-26 21:50:14 +03:00
parent 8288161b30
commit 81019aa90d
3 changed files with 14 additions and 4 deletions

View File

@@ -333,6 +333,13 @@ func (s *Server) Scheme() string {
if s.IsSecure() || (s.Config.CertFile != "" && s.Config.KeyFile != "") {
scheme = "https://"
}
// but if virtual scheme is setted and it differs from the real scheme, return the vscheme
// the developer should set it correctly, http:// or https:// or anything at the future:P
vscheme := s.Config.VScheme
if len(vscheme) > 0 && vscheme != scheme {
return vscheme
}
return scheme
}