mirror of
https://github.com/infinite-iroha/touka.git
synced 2026-02-03 08:51:11 +08:00
add GetHTTPC
This commit is contained in:
parent
6eac3b2046
commit
385b6239c8
1 changed files with 6 additions and 2 deletions
|
|
@ -468,8 +468,7 @@ func (c *Context) ErrorUseHandle(code int) {
|
||||||
c.Abort()
|
c.Abort()
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
// Default error handling if no custom handler is set
|
c.String(code, "%s", http.StatusText(code))
|
||||||
c.String(code, http.StatusText(code))
|
|
||||||
c.Abort()
|
c.Abort()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -478,3 +477,8 @@ func (c *Context) ErrorUseHandle(code int) {
|
||||||
func (c *Context) GetProtocol() string {
|
func (c *Context) GetProtocol() string {
|
||||||
return c.Request.Proto
|
return c.Request.Proto
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetHTTPC 获取框架自带传递的httpc
|
||||||
|
func (c *Context) GetHTTPC() *httpc.Client {
|
||||||
|
return c.HTTPClient
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue