From e25b3965a7c69bc8d2db0f52f42ff122303b2cf0 Mon Sep 17 00:00:00 2001 From: Kyle Zhao Date: Mon, 19 Nov 2018 22:34:02 -0500 Subject: [PATCH] do not overwrite hostname in development (#6623) --- config/application.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/config/application.rb b/config/application.rb index 5a6899084ca..f452dabff8c 100644 --- a/config/application.rb +++ b/config/application.rb @@ -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