From 413de9361ffb7ec5f5cda67c97e5e2a351eec58e Mon Sep 17 00:00:00 2001 From: Blake Erickson Date: Tue, 3 Aug 2021 07:26:48 -0600 Subject: [PATCH] DEV: Disable PATCH requests (#13928) We aren't actually calling any of the PATCH requests, so maybe we should just stick with PUT unless we explicitly need PATCH for something. --- config/routes.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/routes.rb b/config/routes.rb index fd833b8bf51..61c78af70f4 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,6 +8,8 @@ USERNAME_ROUTE_FORMAT = /[%\w.\-]+?/ unless defined? USERNAME_ROUTE_FORMAT BACKUP_ROUTE_FORMAT = /.+\.(sql\.gz|tar\.gz|tgz)/i unless defined? BACKUP_ROUTE_FORMAT Discourse::Application.routes.draw do + def patch(*) end # Disable PATCH requests + scope path: nil, constraints: { format: /(json|html|\*\/\*)/ } do relative_url_root = (defined?(Rails.configuration.relative_url_root) && Rails.configuration.relative_url_root) ? Rails.configuration.relative_url_root + '/' : '/'