-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Header version ignored #133
Comments
Grape from the frontier branch or shipped version? |
tried the shipped version, explicit master branch and frontier branch. |
Try this:
It will be as you expected. I don't know whether it's a but in curl on OS X or not, but my version of curl does not support grape-wiki-way of passing headers too :) (it assumes accept header as asterisk/asterisk, that's why you have always 'v2') |
Thats what I've tried on my linux box and I always got response from v2.
|
With pull #144 it's doing the correct thing on frontier. If you're still having this issue, reopen it and post the output from |
I'm also having a problem with enabling the versioning in Grape. I've created a new Rails 3.2.9 project with Grape 0.2.2 included here: https://github.com/seanmoon/grape-versioning-example The output from In my actual project, I'd like to include V1 and V2 via separate source files, but even in this more simplified situation I'm running into an issue. Any suggestions or help would be appreciated. Here's the source for the API. https://github.com/seanmoon/grape-versioning-example/blob/master/app/api/api.rb |
I'll just reopen this. |
I'll try to take a look at this soon-ish. A failing spec for this would be ideal of course. |
Looks like the issue I'm seeing only happens when the I've written a failing spec here: https://github.com/seanmoon/grape The specs are also failing using In my example project I get a |
cc: @jwkoelewijn who has implemented a lot of this code, I could use some help |
Fixed in 548ceb4 Thanks @seanmoon for the spec, you're correct, it was broken when using Header-based versioning works by mounting every version in an identical path, including the prefix. If the version doesn't match from the header, the next one will be tried. With the prefixer middleware we would strip the prefix from |
…ltered with path versioning. Got rid of the prefixer middleware, which is not generic across versioning schemes, but specific to the path versioner.
Awesome, thanks! |
This may be similiar to #124 and #74
According to several slides and docs and wiki pages, I tried this:
The requests above always returns "v2" regardless of the header being set. I also tested those without using the
strict
param, but got the same results.The text was updated successfully, but these errors were encountered: