Merge pull request #4615 from techAPJ/master

FIX: make upload extension optional in route
This commit is contained in:
Arpit Jalan 2016-12-19 15:46:39 +05:30 committed by GitHub
commit b7a23eba06
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}/ }