mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
parent
e943ed24be
commit
ef1d00349e
@ -47,9 +47,17 @@ type (
|
||||
// Header returns `engine.Header`.
|
||||
Header() Header
|
||||
|
||||
// Proto() string
|
||||
// ProtoMajor() int
|
||||
// ProtoMinor() int
|
||||
// Referer returns the referring URL, if sent in the request.
|
||||
Referer() string
|
||||
|
||||
// Protocol returns the protocol version string of the HTTP request.
|
||||
// Protocol() string
|
||||
|
||||
// ProtocolMajor returns the major protocol version of the HTTP request.
|
||||
// ProtocolMajor() int
|
||||
|
||||
// ProtocolMinor returns the minor protocol version of the HTTP request.
|
||||
// ProtocolMinor() int
|
||||
|
||||
// ContentLength returns the size of request's body.
|
||||
ContentLength() int
|
||||
|
@ -58,6 +58,11 @@ func (r *Request) Header() engine.Header {
|
||||
return r.header
|
||||
}
|
||||
|
||||
// Referer implements `engine.Request#Referer` function.
|
||||
func (r *Request) Referer() string {
|
||||
return r.Referer()
|
||||
}
|
||||
|
||||
// ContentLength implements `engine.Request#ContentLength` function.
|
||||
func (r *Request) ContentLength() int {
|
||||
return r.Request.Header.ContentLength()
|
||||
|
@ -64,6 +64,11 @@ func (r *Request) Header() engine.Header {
|
||||
return r.header
|
||||
}
|
||||
|
||||
// Referer implements `engine.Request#Referer` function.
|
||||
func (r *Request) Referer() string {
|
||||
return r.Request.Referer()
|
||||
}
|
||||
|
||||
// func Proto() string {
|
||||
// return r.request.Proto()
|
||||
// }
|
||||
|
@ -48,8 +48,7 @@ type (
|
||||
var (
|
||||
// DefaultLoggerConfig is the default logger middleware config.
|
||||
DefaultLoggerConfig = LoggerConfig{
|
||||
Format: "time=${time_rfc3339}, remote_ip=${remote_ip}, method=${method}, " +
|
||||
"uri=${uri}, status=${status}, took=${response_time}, sent=${response_size} bytes\n",
|
||||
Format: `{"time": "${time_rfc3339}", "remote_ip": "${remote_ip}", "method": "${method}", "uri": "${uri}", "status": ${status}, "took": "${response_time}", "sent": "${response_size}B"}`,
|
||||
color: color.New(),
|
||||
Output: os.Stdout,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user