1
0
镜像自地址 https://github.com/astaxie/beego.git 已同步 2025-07-17 18:52:16 +00:00

Merge pull request #2086 from Maxgis/issue_accept_encoding

Refactoring
这个提交包含在:
astaxie
2016-08-07 16:25:51 +08:00
提交者 GitHub
当前提交 01c3812520

查看文件

@@ -146,18 +146,12 @@ 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
fmt.Fprintf(&b, "; HttpOnly")
}
}
if httponly {
fmt.Fprintf(&b, "; HttpOnly")
}
output.Context.ResponseWriter.Header().Add("Set-Cookie", b.String())
}