Commit cba257e
committed
Added consideration of vendors when using header based version selection
class MyAPI < Grape::API
vendor 'v1', :using => :header, :vendor => 'twitter', :format => :json
get '/' do
'hello world'
end
end
and let it still return the '/' even when the accept-header
"application/vnd.some_other_vendor-v1+json" was given. This commit will
let it return a 404, and sets the X-Cascade pass as well.
I've added this because although the version is right, part of the
Accept header (the vendor part) is not correct.1 parent 4332cb0 commit cba257e
File tree
2 files changed
+24
-1
lines changed- lib/grape/middleware/versioner
- spec/grape/middleware/versioner
2 files changed
+24
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
83 | 103 | | |
84 | 104 | | |
85 | 105 | | |
| |||
0 commit comments