Skip to content

Return status 405 when router error was ErrMethodNotAllowed #12

Description

@strowk

I think it could be convenient impovement here. Currently 404 is coded for all router errors.

See example how it is done in another lib:
https://github.com/getkin/kin-openapi/blob/529285c16a9d45f7f908c1d61e67abcc070d192f/openapi3filter/validation_error_encoder.go#L55-L57

Place to put it here:

case *routers.RouteError:
// We've got a bad request, the path requested doesn't match
// either server, or path, or something.
return echo.NewHTTPError(http.StatusNotFound, e.Reason)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions