Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Greenlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arbeitsgruppe Hardwarenahe IT-Systeme
Greenlight
Commits
0d1df083
Unverified
Commit
0d1df083
authored
Aug 15, 2018
by
Joshua Arts
Committed by
GitHub
Aug 15, 2018
Browse files
Options
Downloads
Plain Diff
Merge pull request #241 from bruckwubete/master
fix force ssl logic for lb configuration
parents
f0610f36
0d252add
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/application_controller.rb
+7
-0
7 additions, 0 deletions
app/controllers/application_controller.rb
config/environments/production.rb
+0
-3
0 additions, 3 deletions
config/environments/production.rb
with
7 additions
and
3 deletions
app/controllers/application_controller.rb
+
7
−
0
View file @
0d1df083
...
...
@@ -24,6 +24,9 @@ class ApplicationController < ActionController::Base
before_action
:migration_error?
before_action
:set_locale
# Force SSL for loadbalancer configurations.
before_filter
:redirect_to_https
protect_from_forgery
with: :exception
MEETING_NAME_LIMIT
=
90
...
...
@@ -88,4 +91,8 @@ class ApplicationController < ActionController::Base
moderator_message:
"
#{
invite_msg
}
\n\n
#{
request
.
base_url
+
room_path
(
@room
)
}
"
,
}
end
def
redirect_to_https
redirect_to
protocol:
"https://"
if
loadbalanced_configuration?
&&
request
.
headers
[
"X-Forwarded-Proto"
]
==
"http"
end
end
This diff is collapsed.
Click to expand it.
config/environments/production.rb
+
0
−
3
View file @
0d1df083
...
...
@@ -44,9 +44,6 @@ Rails.application.configure do
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
config
.
force_ssl
=
(
ENV
[
"ENABLE_SSL"
]
==
"true"
)
# Force SSL for loadbalancer configurations.
config
.
force_ssl
=
true
if
ENV
[
"LOADBALANCER_ENDPOINT"
].
present?
&&
ENV
[
"LOADBALANCER_SECRET"
].
present?
# Use the lowest log level to ensure availability of diagnostic information
# when problems arise.
config
.
log_level
=
:debug
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment