Implement GetHost()
This commit is contained in:
parent
4821aa05b5
commit
517eb1652a
|
@ -65,6 +65,10 @@ func (c *FastHTTPContext) GetTLSServerName() string {
|
|||
return c.ctx.TLSConnectionState().ServerName
|
||||
}
|
||||
|
||||
func (c *FastHTTPContext) GetHost() string {
|
||||
return string(c.ctx.Request.Host())
|
||||
}
|
||||
|
||||
func (c *FastHTTPContext) GetRequestHeader(name string) string {
|
||||
return string(c.ctx.Request.Header.Peek(name))
|
||||
}
|
||||
|
|
|
@ -65,6 +65,10 @@ func (c *NetHTTPContext) GetTLSServerName() string {
|
|||
return c.httpRequest.TLS.ServerName
|
||||
}
|
||||
|
||||
func (c *NetHTTPContext) GetHost() string {
|
||||
return c.httpRequest.Host
|
||||
}
|
||||
|
||||
func (c *NetHTTPContext) GetRequestHeader(name string) string {
|
||||
return c.httpRequest.Header.Get(name)
|
||||
|
||||
|
|
|
@ -39,6 +39,7 @@ type RequestContext interface {
|
|||
GetRequestTime() time.Time
|
||||
GetTLSServerName() string
|
||||
GetBody() io.Reader
|
||||
GetHost() string
|
||||
GetRequestHeader(name string) string
|
||||
GetResponseHeader(name string) string
|
||||
AddResponseHeader(name string, value string)
|
||||
|
|
Loading…
Reference in a new issue