From 117d5f1b6aa89942b36f33c0a5581897dd97aa2f Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 27 Jun 2017 10:03:00 +0900 Subject: [PATCH] FIX: `/u.json` should return 404 instead of 500. --- config/routes.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 964d6e11496..d4d89799b12 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -309,7 +309,9 @@ Discourse::Application.routes.draw do get "user_preferences" => "users#user_preferences_redirect" %w{users u}.each_with_index do |root_path, index| - resources :users, except: [:new, :show, :update, :destroy], path: root_path do + get "#{root_path}" => "users#index", constraints: { format: 'html' } + + resources :users, except: [:index, :new, :show, :update, :destroy], path: root_path do collection do get "check_username" get "is_local_username"