go做web服务器,如何确定客户端是http还是https协议?
// 标准库: r = *http.Request
// gin: r = c.Request
if r.TSL == nil {
// 不是通过https访问
}
更多评论
go做web服务器,如何确定客户端是http还是https协议?
// 标准库: r = *http.Request
// gin: r = c.Request
if r.TSL == nil {
// 不是通过https访问
}