Class Grape::Middleware::Versioner::AcceptVersionHeader
In: lib/grape/middleware/versioner/accept_version_header.rb
Parent: Base

This middleware sets various version related rack environment variables based on the HTTP Accept-Version header

Example: For request header

   Accept-Version: v1

The following rack env variables are set:

   env['api.version']  => 'v1'

If version does not match this route, then a 406 is raised with X-Cascade header to alert Grape::Router to attempt the next matched route.

Methods

before  

Public Instance methods

[Validate]