mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Remove redirect to certified hostname - this is now performed by nginx. Fixes SSL errors.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
protect_from_forgery
|
||||
before_filter :require_certified_hostname
|
||||
|
||||
include EnterprisesHelper
|
||||
|
||||
@@ -17,6 +16,7 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
|
||||
def require_distributor_chosen
|
||||
@@ -42,17 +42,6 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
end
|
||||
|
||||
# There are several domains that point to the production server, but only one
|
||||
# (vic.openfoodnetwork.org) that has the SSL certificate. Redirect all requests to this
|
||||
# domain to avoid showing customers a scary invalid certificate error.
|
||||
def require_certified_hostname
|
||||
certified_host = "openfoodnetwork.org.au"
|
||||
|
||||
if Rails.env.production? && request.host != certified_host
|
||||
redirect_to "http://#{certified_host}#{request.fullpath}"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# All render calls within the block will be performed with the specified format
|
||||
# Useful for rendering html within a JSON response, particularly if the specified
|
||||
|
||||
Reference in New Issue
Block a user