diff --git a/httputils/context.go b/httputils/context.go index c71bff6..518e410 100644 --- a/httputils/context.go +++ b/httputils/context.go @@ -143,6 +143,14 @@ func (c *RequestContext) ServeFile(path string) { } } +func (c *RequestContext) ServeBytes(content []byte) { + if c.fasthttp != nil { + c.fasthttp.Write(content) + } else if c.httpWriter != nil { + (*c.httpWriter).Write(content) + } +} + func (c *RequestContext) SetResponseCode(code int) { if c.fasthttp != nil { c.fasthttp.Response.SetStatusCode(code)