Enforce domain, host header validation against domain setting, Refactoring of PR #1866, Closes #1732

This commit is contained in:
Torkel Ödegaard
2015-05-05 11:21:06 +02:00
parent 1f2cba81eb
commit 34539c0c13
7 changed files with 39 additions and 11 deletions
+2 -1
View File
@@ -65,6 +65,7 @@ var (
RouterLogging bool
StaticRootPath string
EnableGzip bool
EnforceDomain bool
// Security settings.
SecretKey string
@@ -355,10 +356,10 @@ func NewConfigContext(args *CommandLineArgs) {
Domain = server.Key("domain").MustString("localhost")
HttpAddr = server.Key("http_addr").MustString("0.0.0.0")
HttpPort = server.Key("http_port").MustString("3000")
StaticRootPath = makeAbsolute(server.Key("static_root_path").String(), HomePath)
RouterLogging = server.Key("router_logging").MustBool(false)
EnableGzip = server.Key("enable_gzip").MustBool(false)
EnforceDomain = server.Key("enforce_domain").MustBool(false)
security := Cfg.Section("security")
SecretKey = security.Key("secret_key").String()