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

Ensure default URL host never has a trailing / #503

Merged
merged 1 commit into from
Mar 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

# Mailers
config.action_mailer.default_url_options = {
:host => ENV.fetch('HOST_URL', 'localhost:3000')
host: ENV.fetch('HOST_URL', 'localhost:3000').chomp('/')
}
config.action_mailer.delivery_method = :sendmail
config.action_mailer.raise_delivery_errors = true
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

# Action Mailer configuration
config.action_mailer.default_url_options = {
host: ENV.fetch('HOST_URL', 'api.monitoring.envirodatagov.org')
host: ENV.fetch('HOST_URL', 'api.monitoring.envirodatagov.org').chomp('/')
}
config.action_mailer.raise_delivery_errors = true
config.action_mailer.perform_caching = false
Expand Down
4 changes: 3 additions & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
config.action_mailer.perform_caching = false

# Action Mailer host default
config.action_mailer.default_url_options = { :host => ENV.fetch('HOST_URL', 'localhost') }
config.action_mailer.default_url_options = {
host: ENV.fetch('HOST_URL', 'localhost').chomp('/')
}

# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
Expand Down