api: log right protocol version of responses

This commit is contained in:
aler9
2021-08-14 11:08:02 +02:00
parent e0a215ab53
commit 7765de44fc
+1 -1
View File
@@ -337,7 +337,7 @@ func (a *api) mwLog(ctx *gin.Context) {
ctx.Writer.Header().Set("Server", "rtsp-simple-server")
var buf bytes.Buffer
fmt.Fprintf(&buf, "HTTP/1.1 %d %s\n", ctx.Writer.Status(), http.StatusText(ctx.Writer.Status()))
fmt.Fprintf(&buf, "%s %d %s\n", ctx.Request.Proto, ctx.Writer.Status(), http.StatusText(ctx.Writer.Status()))
ctx.Writer.Header().Write(&buf)
buf.Write([]byte("\n"))
buf.Write(blw.buf.Bytes())