Skip to content

Commit

Permalink
context repsonder allow Request is nil
Browse files Browse the repository at this point in the history
  • Loading branch information
xgfone committed May 12, 2024
1 parent 387b20d commit 6775914
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions http/reqresp/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ func runhandler(w http.ResponseWriter, r *http.Request, f Handler) {
/// ----------------------------------------------------------------------- ///

func RespondResultResponseWithContext(c *Context, response result.Response) {
if c.Request == nil {
respondstd(c, response)
return
}

xcode := c.Request.Header.Get("X-Response-Code")
if xcode == "" {
xcode = c.GetQuery("X-Response-Code")
Expand Down

0 comments on commit 6775914

Please sign in to comment.