DEV: Don't expose wizard qunit route in production.

DEV: Don’t expose wizard qunit route in production.

From a19780d7a67dea4dd359b79c9d0a1f336ac0dea0 Mon Sep 17 00:00:00 2001
From: Guo Xiang Tan <tgx_world@hotmail.com>
Date: Fri, 23 Nov 2018 13:15:40 +0800
Subject: [PATCH] DEV: Don't expose wizard qunit route in production.


diff --git a/config/routes.rb b/config/routes.rb
index a9fed0f..0a8263b 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -59,7 +59,6 @@ Discourse::Application.routes.draw do
   get "srv/status" => "forums#status"
 
   get "wizard" => "wizard#index"
-  get "wizard/qunit" => "wizard#qunit"
   get 'wizard/steps' => 'steps#index'
   get 'wizard/steps/:id' => "wizard#index"
   put 'wizard/steps/:id' => "steps#update"
@@ -823,8 +822,9 @@ Discourse::Application.routes.draw do
 
   get "/themes/assets/:ids" => "themes#assets"
 
-  if Rails.env == "test" || Rails.env == "development"
+  unless Rails.env.production?
     get "/qunit" => "qunit#index"
+    get "/wizard/qunit" => "wizard#qunit"
   end
 
   post "/push_notifications/subscribe" => "push_notification#subscribe"

GitHub

3 Likes