1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 13:20:55 +00:00

Merge pull request #2086 from Maxgis/issue_accept_encoding

Refactoring
This commit is contained in:
astaxie 2016-08-07 16:25:51 +08:00 committed by GitHub
commit 01c3812520

View File

@ -146,17 +146,11 @@ func (output *BeegoOutput) Cookie(name string, value string, others ...interface
}
// default false. for session cookie default true
httponly := false
if len(others) > 4 {
if v, ok := others[4].(bool); ok && v {
// HttpOnly = true
httponly = true
}
}
if httponly {
fmt.Fprintf(&b, "; HttpOnly")
}
}
output.Context.ResponseWriter.Header().Add("Set-Cookie", b.String())
}