-
Notifications
You must be signed in to change notification settings - Fork 17.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
ca5ba14
commit 4b40307
Showing
1 changed file
with
41 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters