-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create InvalidAPIEndpointHandler to be chi-Mount'd on BaseURL
This commit works to close issue #2190 by creating handler that returns ErrInvalidAPIEndpoint when called. This will be used by chi Mount'ing the handler to a specified route so that any calls to a route downstream the Mount'd pattern will respond with the ErrInvalidAPIEndpoint error. Also add corresponding test, TestInvalidRoute, to test InvalidAPIEndpointHandler. Create middleware to catch downstream routes from BaseURL This commit works to close issue #2190 by creating middleware to ensure users that call routes downstream of the BaseURL (i.e. /api/v1) are return an invalid endpoint error and internal error status. Remove BaseURLHandler
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 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
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