diff --git a/config/routes.rb b/config/routes.rb index 49402b58b0..87580f122b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -384,9 +384,9 @@ Discourse::Application.routes.draw do post "uploads" => "uploads#create" # used to download original images - get "uploads/:site/:sha.:extension" => "uploads#show", constraints: { site: /\w+/, sha: /\h{40}/, extension: /[a-z0-9\.]+/i } + get "uploads/:site/:sha(.:extension)" => "uploads#show", constraints: { site: /\w+/, sha: /\h{40}/, extension: /[a-z0-9\.]+/i } # used to download attachments - get "uploads/:site/original/:tree:sha.:extension" => "uploads#show", constraints: { site: /\w+/, tree: /([a-z0-9]+\/)+/i, sha: /\h{40}/, extension: /[a-z0-9\.]+/i } + get "uploads/:site/original/:tree:sha(.:extension)" => "uploads#show", constraints: { site: /\w+/, tree: /([a-z0-9]+\/)+/i, sha: /\h{40}/, extension: /[a-z0-9\.]+/i } # used to download attachments (old route) get "uploads/:site/:id/:sha" => "uploads#show", constraints: { site: /\w+/, id: /\d+/, sha: /\h{16}/ }