This commit is contained in:
houseme
2022-03-09 21:27:02 +08:00
parent be47203732
commit 3d5ff3b250

View File

@ -18,8 +18,12 @@ func (s *Server) handleAccessLog(r *Request) {
if !s.IsAccessLogEnabled() {
return
}
scheme := "http"
if r.TLS != nil {
var (
scheme = "http"
proto = r.Header.Get("X-Forwarded-Proto")
)
if r.TLS != nil || gstr.Equal(proto, "https") {
scheme = "https"
}
s.Logger().File(s.config.AccessLogPattern).