From 385b6239c8f4c0ddcf524187750fd3da9af5575d Mon Sep 17 00:00:00 2001 From: wjqserver <114663932+WJQSERVER@users.noreply.github.com> Date: Wed, 4 Jun 2025 18:40:00 +0800 Subject: [PATCH] add GetHTTPC --- context.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/context.go b/context.go index 6cb6a07..fe0bd70 100644 --- a/context.go +++ b/context.go @@ -468,8 +468,7 @@ func (c *Context) ErrorUseHandle(code int) { c.Abort() return } else { - // Default error handling if no custom handler is set - c.String(code, http.StatusText(code)) + c.String(code, "%s", http.StatusText(code)) c.Abort() } } @@ -478,3 +477,8 @@ func (c *Context) ErrorUseHandle(code int) { func (c *Context) GetProtocol() string { return c.Request.Proto } + +// GetHTTPC 获取框架自带传递的httpc +func (c *Context) GetHTTPC() *httpc.Client { + return c.HTTPClient +}