mirror of
https://github.com/discourse/discourse.git
synced 2025-03-21 18:05:31 +08:00
FIX: make upload extension optional in route
This commit is contained in:
parent
c7289f423f
commit
563bcfb705
@ -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}/ }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user