Skip to content

Commit

Permalink
add RawResponse getter to hono context
Browse files Browse the repository at this point in the history
  • Loading branch information
syumai committed Feb 11, 2024
1 parent fa22eea commit 8ea4e2b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions exp/hono/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
Expand Down

0 comments on commit 8ea4e2b

Please sign in to comment.