Method + Path combination constraints
This update allows you to define constraints for discrete method and path combinations.
See the updated README for more details: https://github.com/Matchbook/rack-ssl-enforcer#method--path-combination-constraints
erg. Travis failed, but all tests passed when I ran them locally.
ooohhh, Travis is testing with 1.8.7, which doesn't support a #length method for Symbol
Amended commit e53a1df to be compatible with Ruby 1.8.7
Thank you @wyattisimo!
It looks good to me, what do you think @tobmatth / @thibaudgg ?
Looks good!
amended commit 10594b6 to fix spelling: "seperately" => "separately"
Don't merge this yet. There's a bug when specifying a :methods_with_paths constraint along with other constraints because in the enforce_ssl_for? method, the if/else block creates two distinct paths of logic, but is contained within a loop using all?.
@rymai I think there's a bug when specifying a :methods_with_paths constraint along with other constraints. Would not merge.
;)
@rymai @tobmatth Amended commit 00ddb0e with the fixes and a "complex" spec to test specifying :only, :only_methods, and :only_methods_with_paths constraints all at the same time.
This ended up requiring more significant changes than I originally expected. I tweaked enforce_ssl? so it's handling a little more logic and sending the complete list of provided constraints to enforce_ssl_for? (instead of only sending one class of constraints at a time). I think this made it easier to define the logic for combining the groups of constraints properly and actually makes it a little more readable.
Let me know what you think.
Looks good to me now. @tobmatth is it ok for you?
+1 for this pull request!
@wyattisimo Could you please rebase on master? Thanks!
@tobmatth What do you think of this PR now?