add RawResponse getter to hono context

This commit is contained in:
syumai 2024-02-11 23:16:11 +09:00
parent fa22eea00b
commit 8ea4e2bf5f

View File

@ -45,6 +45,10 @@ func (c *Context) SetStatus(statusCode int) {
c.ctxObj.Call("status", statusCode)
}
func (c *Context) RawResponse() js.Value {
return c.ctxObj.Get("res")
}
func (c *Context) ResponseBody() io.ReadCloser {
return jsutil.ConvertReadableStreamToReadCloser(c.ctxObj.Get("res").Get("body"))
}