Skip to content

Commit

Permalink
ssl support.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpestritto committed Nov 17, 2015
1 parent ab26211 commit cdcfa55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/swagger_engine/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ class ApplicationController < ActionController::Base

before_filter :authenticate

force_ssl if: :require_ssl
def require_ssl
SwaggerEngine.configuration.force_ssl || false
end

protected
def authenticate
if SwaggerEngine.configuration.admin_username
Expand Down
2 changes: 2 additions & 0 deletions lib/swagger_engine/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ class Configuration
attr_accessor :oauth_app_name
attr_accessor :oauth_realm
attr_accessor :oauth_redirect_url

attr_accessor :force_ssl
end
class << self
attr_writer :configuration
Expand Down

0 comments on commit cdcfa55

Please sign in to comment.