intridea/grape — Issue #124: Header versioning allows jibberish
Author: mariovisic
Created: 2012-01-18 09:17:43+00:00
State: open

Hi Guys

Currently when header versioning is enabled (even with the strict option) sending a request without a valid vendor string will result in the first version being matched.

On line #37 here the loop will not run if the Accept header doesn't match the string.
https://github.com/intridea/grape/blob/master/lib/grape/middleware/versioner/header.rb#L37

This doesn't seem like the correct behaviour to me. Would it be better to render a 404 instead? If so then i'll see about adding a failing test + patch to solve the problem.