fix(rendering): fixed server side rendering issue when sertting enforce_domain to true, fixes #6769

This commit is contained in:
Torkel Ödegaard
2016-12-05 11:20:01 +01:00
parent a9c0f66cda
commit cc46b81961
2 changed files with 11 additions and 5 deletions
+5 -4
View File
@@ -46,14 +46,15 @@ func newMacaron() *macaron.Macaron {
Delims: macaron.Delims{Left: "[[", Right: "]]"},
}))
if setting.EnforceDomain {
m.Use(middleware.ValidateHostHeader(setting.Domain))
}
m.Use(middleware.GetContextHandler())
m.Use(middleware.Sessioner(&setting.SessionOptions))
m.Use(middleware.RequestMetrics())
// needs to be after context handler
if setting.EnforceDomain {
m.Use(middleware.ValidateHostHeader(setting.Domain))
}
return m
}