Special case for settings in rewrite is not needed

This commit is contained in:
Piotr Sarnacki 2014-04-01 16:58:36 +02:00
parent 11e814055e
commit 54fb58a941

View File

@ -5,7 +5,6 @@ class Travis::Api::App
class Rewrite < Middleware
FORMAT = %r(\.(json|xml|png|txt|atom|svg)$)
V1_REPO_URL = %r(^(/[^/]+/[^/]+(?:/builds(?:/[\d]+)?|/cc)?)$)
SETTINGS_URL = %r(^/settings)
helpers :accept
@ -38,7 +37,7 @@ class Travis::Api::App
end
def redirect_v1_named_repo_path
if request.path =~ V1_REPO_URL && request.path !~ SETTINGS_URL
if request.path =~ V1_REPO_URL
force_redirect("/repositories#{$1}.#{env['travis.format']}")
end
end