Skip to content

Commit 09dcba1

Browse files
kesuskimvishr
authored andcommitted
rename proto to protocol
1 parent 2a54603 commit 09dcba1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

middleware/logger.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ type (
3333
// - host
3434
// - method
3535
// - path
36-
// - proto
36+
// - protocol
3737
// - referer
3838
// - user_agent
3939
// - status
@@ -155,7 +155,7 @@ func LoggerWithConfig(config LoggerConfig) echo.MiddlewareFunc {
155155
p = "/"
156156
}
157157
return buf.WriteString(p)
158-
case "proto":
158+
case "protocol":
159159
return buf.WriteString(req.Proto)
160160
case "referer":
161161
return buf.WriteString(req.Referer())

middleware/logger_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func TestLoggerTemplate(t *testing.T) {
9292
Format: `{"time":"${time_rfc3339_nano}","id":"${id}","remote_ip":"${remote_ip}","host":"${host}","user_agent":"${user_agent}",` +
9393
`"method":"${method}","uri":"${uri}","status":${status}, "latency":${latency},` +
9494
`"latency_human":"${latency_human}","bytes_in":${bytes_in}, "path":"${path}", "referer":"${referer}",` +
95-
`"bytes_out":${bytes_out},"ch":"${header:X-Custom-Header}", "proto":"${proto}"` +
95+
`"bytes_out":${bytes_out},"ch":"${header:X-Custom-Header}", "protocol":"${protocol}"` +
9696
`"us":"${query:username}", "cf":"${form:username}", "session":"${cookie:session}"}` + "\n",
9797
Output: buf,
9898
}))

0 commit comments

Comments
 (0)