-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow rack/mount cascading to be skipped on header
When using header versioning with the :strict policy, Grape currently returns the appropriate error (406 Not Acceptable) but it also returns a X-Cascade header indicating to rack it should keep looking for other routes. While this behavior is expected for various applications, some may need to skip the cascading and explicitly return the error to the requester. For that, a :cascade option was added to the version method. The default value is true (keeping backwards compat), meaning that 406 errors shall be raised along with X-Cascade headers, just like before. Though, if set to false, it 406 errors shall be raised with no X-Cascade headers, therefore telling the router it should not lookup other routes.
- Loading branch information
Showing
4 changed files
with
76 additions
and
7 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