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.
This commit is contained in:
Blake Erickson 2021-08-03 07:26:48 -06:00 committed by GitHub
parent 5c6e7e3401
commit 413de9361f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -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 + '/' : '/'