You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example application or steps to reproduce the problem
Every Plumber API sent an incorrect method to a valid route (e.g. PATCH /route where only GET /route is supported) is affected by this issue.
Describe the problem in detail
Plumber has pr_set_404() and pr_set_error() functions (among other, older approaches) that allow users to control the response body/headers of errors returned from an API. We use this extensively to emit common error structures. However, since #746 the HTTP 405 response has been hardcoded internally and it is no longer possible to control it.
This is not a bug per se (since it is intended behaviour) but it is a regression, since it was previously possible to control HTTP 405 responses from the 404 handler.
I originally proposed in #493 that Plumber have a dedicated handler for HTTP 405 responses (presumably pr_set_405()), and still believe that that is the right level of control here -- I would be happy to implement this myself, too.
The text was updated successfully, but these errors were encountered:
Example application or steps to reproduce the problem
Every Plumber API sent an incorrect method to a valid route (e.g.
PATCH /route
where onlyGET /route
is supported) is affected by this issue.Describe the problem in detail
Plumber has
pr_set_404()
andpr_set_error()
functions (among other, older approaches) that allow users to control the response body/headers of errors returned from an API. We use this extensively to emit common error structures. However, since #746 the HTTP 405 response has been hardcoded internally and it is no longer possible to control it.This is not a bug per se (since it is intended behaviour) but it is a regression, since it was previously possible to control HTTP 405 responses from the 404 handler.
I originally proposed in #493 that Plumber have a dedicated handler for HTTP 405 responses (presumably
pr_set_405()
), and still believe that that is the right level of control here -- I would be happy to implement this myself, too.The text was updated successfully, but these errors were encountered: