Fix callback controllers not working when using a non-default MIME type. #688
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This code makes "on_path?" comparisons in Strategy.rb MIME type agnostic. Please review carefully as I am inexperienced with RoR work and just needed a fix for something I was working on.
Basically, on_path? being MIME type sensitive becomes a problem if someone wants to use a non-default type in their callbacks. In my case I had the route /users/auth/:action/callback(.:format) leading to my omniauth callbacks controller.
I have special template and redirect behaviour for the .tpl format and I used /users/auth/facebook/callback.tpl as a callback which resulted in request.env["omniauth.auth"] not being populated because OmniAuth incorrectly determined I was not on a callback path.
I'm not sure if there is a better way to accomplish this check. Any form of simple pattern matching has the chance of unintended positive matches if people get creative with their routes.