From 73b8cfa7d7dbbb154a65e57505da47e4a618c668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Sun, 31 May 2015 23:06:36 +0200 Subject: [PATCH] FIX: attachment routes --- config/routes.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index b13e0c37fa7..201dd6dd931 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -292,10 +292,10 @@ Discourse::Application.routes.draw do # used to download original images get "uploads/:site/:sha" => "uploads#show", constraints: { site: /\w+/, sha: /[a-f0-9]{40}/ } - # used to download attachments - get "uploads/:site/original/:dir1/:dir2/:sha.:extension" => "uploads#show", constraints: { site: /\w+/, dir1: /[a-f0-9]/, dir2: /[a-f0-9]/, sha: /[a-f0-9]{40}/, extension: /\w{2,}/ } + # used to dowwload attachments + get "uploads/:site/original/:tree/:sha:extension" => "uploads#show", constraints: { site: /\w+/, sha: /[a-f0-9]{40}/, extension: /\.\w{2,}/ } # used to download attachments (old route) - get "uploads/:site/:id/:sha.:extension" => "uploads#show", constraints: { site: /\w+/, id: /\d+/, sha: /[a-f0-9]{16}/, extension: /\w{2,}/ } + get "uploads/:site/:id/:sha:extension" => "uploads#show", constraints: { site: /\w+/, id: /\d+/, sha: /[a-f0-9]{16}/, extension: /\.\w{2,}/ } get "posts" => "posts#latest" get "posts/by_number/:topic_id/:post_number" => "posts#by_number"