diff --git a/lib/travis/web/api_redirect.rb b/lib/travis/web/api_redirect.rb index 04cca3b8..4f022af0 100644 --- a/lib/travis/web/api_redirect.rb +++ b/lib/travis/web/api_redirect.rb @@ -18,7 +18,7 @@ class Travis::Web::ApiRedirect < Sinatra::Base end end - get NotPublicImages.new(%r{^/([^/]+)/([^/]+).png}, %r{^/images/}) do + get NotPublicImages.new(%r{^/([^/]+)/([^/]+)\.png$}, %r{^/images/}) do redirect! end diff --git a/spec/api_redirect_spec.rb b/spec/api_redirect_spec.rb index bc8e2a9a..9993d086 100644 --- a/spec/api_redirect_spec.rb +++ b/spec/api_redirect_spec.rb @@ -10,4 +10,8 @@ describe Travis::Web::ApiRedirect do it 'redirects /:owner/:repo.png' do get('/foo/bar.png').should be_redirect end + + it 'does not redirect /owner/some-png-repo' do + get('/owner/some-png-repo').should_not be_redirect + end end