do not overwrite hostname in development (#6623)

This commit is contained in:
Kyle Zhao 2018-11-19 22:34:02 -05:00 committed by Sam
parent 1b4f2029d7
commit e25b3965a7
1 changed files with 4 additions and 2 deletions

View File

@ -198,8 +198,10 @@ module Discourse
# supports etags (post 1.7)
config.middleware.delete Rack::ETag
require 'middleware/enforce_hostname'
config.middleware.insert_after Rack::MethodOverride, Middleware::EnforceHostname
unless Rails.env.development?
require 'middleware/enforce_hostname'
config.middleware.insert_after Rack::MethodOverride, Middleware::EnforceHostname
end
require 'content_security_policy'
config.middleware.swap ActionDispatch::ContentSecurityPolicy::Middleware, ContentSecurityPolicy::Middleware