Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: customize ServeMux with not found and not allowed handlers #67970

Closed
wants to merge 1 commit into from

Commits on Jun 13, 2024

  1. net/http: customize ServeMux with not found and not allowed handlers

    Before, NotFound and MethodNotAllowed handlers were hard coded.
    With this change, ServeMux behaviour can be customized, and by using
    optional function parameters, backward compatibility is ensured as well.
    Two new functions, namely WithNotFoundHandler and WithNotAllowedHandler,
    are introduced which can be used as arguments to the NewServeMux func.
    hossein1376 committed Jun 13, 2024
    Configuration menu
    Copy the full SHA
    4b40307 View commit details
    Browse the repository at this point in the history