FIX: make upload extension optional in route

This commit is contained in:
Arpit Jalan 2016-12-19 15:05:25 +05:30
parent c7289f423f
commit 563bcfb705
1 changed files with 2 additions and 2 deletions

View File

@ -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}/ }