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
+6 -1
View File
@@ -8,7 +8,12 @@ import (
)
func ValidateHostHeader(domain string) macaron.Handler {
return func(c *macaron.Context) {
return func(c *Context) {
// ignore local render calls
if c.IsRenderCall {
return
}
h := c.Req.Host
if i := strings.Index(h, ":"); i >= 0 {
h = h[:i]