Skip to content
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

Is there a way to combine mutiple only, multiple ignore with strict #68

Closed
akashkamboj opened this issue Mar 16, 2014 · 6 comments
Closed

Comments

@akashkamboj
Copy link

Hey

I have a site where users, settings pages required SSL, rest pages I don't want to run on SSL. both the pages shows some images. So I want assets, system directory to ignore SSL, this is the config I tried with no luck:

config.middleware.use Rack::SslEnforcer, only: ['/users/', '/settings/'], ignore:  ['/assets/', '/system/'], strict: true

Is this scenario possible with rack-ssl-enforcer?

@tobmatth
Copy link
Owner

Hey,

strict forces every non matching constraint to http, so this:
config.middleware.use Rack::SslEnforcer, only: ['/users/', '/settings/'], strict: true
should force your users and settings paths to SSL, while everything else will be forced to http...

@akashkamboj
Copy link
Author

Isn't there a way to ignore assets, system with strict on?

@tobmatth
Copy link
Owner

Basically i see no reason why

config.middleware.use Rack::SslEnforcer, only: ['/users/', '/settings/'], ignore: ['/assets/', '/system/'], strict: true

wouldn't work. Could you provide a failing test case?

@akashkamboj
Copy link
Author

what's the difference in above and this:

config.middleware.use Rack::SslEnforcer, only: [%r{^/users}, %r{^/settings}], ignore: [%r{^/assets}, %r{^/system}], strict: true

because this seems working fine :)

@akashkamboj
Copy link
Author

Another issue is regarding only_hosts and only combination.

On another thought actually i have an opened issue for that, lemme discuss that there. Closing this.

@tobmatth
Copy link
Owner

Meh,

sorry i always forget why i never liked the string constraints: '/users/' will extactly match /users/, not /users/john or anything else...

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

No branches or pull requests

2 participants