Skip to content

Commit f1e96bc

Browse files
y-yagielazarl
authored andcommitted
Update return response example to follow current API
1 parent 9d40249 commit f1e96bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Finally, we have convenience function to throw a quick response
6060
6161
proxy.OnResponse(hasGoProxyHeader).DoFunc(func(r*http.Response,ctx *goproxy.ProxyCtx)*http.Response {
6262
r.Body.Close()
63-
return goproxy.ForbiddenTextResponse(ctx.Req,"Can't see response with X-GoProxy header!")
63+
return goproxy.NewResponse(ctx.Req, goproxy.ContentTypeText, http.StatusForbidden, "Can't see response with X-GoProxy header!")
6464
})
6565
6666
we close the body of the original repsonse, and return a new 403 response with a short message.

0 commit comments

Comments
 (0)