fasthttp-routing icon indicating copy to clipboard operation
fasthttp-routing copied to clipboard

fasthttp-routing not writing user set headers on user handler error

Open kostrahb opened this issue 6 years ago • 1 comments

As I pointed here the fasthttp-routing uses builtin Error() function of fasthttp.RequestCtx in it's handler (file report.go lines 103 and 105). This function however completely resets response which introduces problem e.g. when returning error 401 (it should return header WWW-Authenticate in response and resetting response deletes all headers). Would it be possible to implement custom error handling function which would correctly print all user-set headers in response on error encounter?

kostrahb avatar Oct 26 '18 12:10 kostrahb

I have created a pull request to fix this issue.

kostrahb avatar Oct 29 '18 09:10 kostrahb