This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Served multiplexer now allows handler overrides.
The served multiplexer now allows you to override a specific handler pattern. Previous behaviour was to simply append the new matching handler onto the end of the handler stack, and therefore it would never be called since any match would already be dispatched to the first definition. The new behaviour is that any handler definition whose pattern matches an existing handler will remove the previous handler from the stack before being appended to the end. This means for resolving the order of precendence of an overriding handler you simply follow the sames rules as if the original overriden handler had never existed, rather than assuming that the new handler takes the position of the original. For example, given the following handler definitions: handle("/foo").get(foo); handle("/" ).get(bar); handle("/foo").get(baz); // Overrides the previous by removing it And the following request: GET /foo HTTP/1.1 The handler 'bar' is called since it matches and comes before the new '/foo' handler.
- Loading branch information
Showing
4 changed files
with
93 additions
and
9 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
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