Skip to content

Conversation

@namusyaka
Copy link
Contributor

@namusyaka namusyaka commented Nov 5, 2016

ref #1089

Conventional, the :any routes had been searched after matching first route and 405 routes.
This PR fixes the issue by adding the :any routes processing before 405 processing.

end
subject.route :any, '*path' do
error! :not_found, 404
end
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This route is incorrect now.

@namusyaka
Copy link
Contributor Author

@dblock I think we should add the explanation about this into UPGRADING.md, right?

CHANGELOG.md Outdated
#### Fixes

* [#1505](https://github.com/ruby-grape/grape/pull/1505): Run `before` and `after` callbacks, but skip the rest when handling OPTIONS - [@jlfaber](https://github.com/jlfaber).
* [#1517](https://github.com/ruby-grape/grape/pull/1517): Modify the priority of ANY routes, fixes #1089 - [@namusyaka](https://github.com/namusyaka), [@wagenet](https://github.com/wagenet)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a period at the end :) and I would do [#1517](...), [#1089]() ...:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omg, thanks :)

end

def self.supported_methods
@supported_methods ||= Grape::Http::Headers::SUPPORTED_METHODS + ['ANY']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe * instead of ANY? Just in case ANY one day becomes an HTTP verb :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it.

@dblock
Copy link
Member

dblock commented Nov 5, 2016

Definitely needs a note in UPGRADING. Thanks!

@namusyaka
Copy link
Contributor Author

@dblock Could you review this again?

@namusyaka namusyaka changed the title Modify the priority of ANY routes, fixes #1089 Modify the priority of :any routes, fixes #1089 Nov 6, 2016
CHANGELOG.md Outdated
#### Fixes

* [#1505](https://github.com/ruby-grape/grape/pull/1505): Run `before` and `after` callbacks, but skip the rest when handling OPTIONS - [@jlfaber](https://github.com/jlfaber).
* [#1517](https://github.com/ruby-grape/grape/pull/1517): Modify the priority of ANY routes, fixes #1089 - [@namusyaka](https://github.com/namusyaka), [@wagenet](https://github.com/wagenet).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be:

 [#1517](https://github.com/ruby-grape/grape/pull/1517), [#1089](https://github.com/ruby-grape/grape/pull/1089): Fix: priority of ANY routes - [@namusyaka](https://github.com/namusyaka), [@wagenet](https://github.com/wagenet).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, fixed.

@dblock
Copy link
Member

dblock commented Nov 6, 2016

I corrected some English and merged via e489995. Thank you.

@dblock dblock closed this Nov 6, 2016
@namusyaka
Copy link
Contributor Author

@dblock Thanks!

end
end

send('get', 'nested')
Copy link
Member

@dblock dblock Nov 6, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just noticing this. This should just be get 'nested/something'..., I'll update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I missed this. Sorry ;(

@namusyaka namusyaka deleted the fix-1089 branch November 12, 2016 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants