diff --git a/CONTRIBUTORS b/CONTRIBUTORS --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -13,9 +13,11 @@ List of contributors to Kallithea projec Søren Løvborg 2015-2016 Angel Ezquerra 2016 Asterios Dimitriou 2016 + Kateryna Musina 2016 Konstantin Veretennicov 2016 Oscar Curero 2016 Robert James Dennington 2016 + timeless@gmail.com 2016 YFdyh000 2016 Aras Pranckevičius 2012-2013 2015 Sean Farley 2013-2015 diff --git a/kallithea/lib/base.py b/kallithea/lib/base.py --- a/kallithea/lib/base.py +++ b/kallithea/lib/base.py @@ -202,7 +202,7 @@ class BaseVCSController(object): from kallithea.lib.utils import get_repo_by_id by_id_match = get_repo_by_id(repo_name) if by_id_match: - data[1] = by_id_match + data[1] = safe_str(by_id_match) return '/'.join(data) diff --git a/kallithea/lib/middleware/simplehg.py b/kallithea/lib/middleware/simplehg.py --- a/kallithea/lib/middleware/simplehg.py +++ b/kallithea/lib/middleware/simplehg.py @@ -84,7 +84,7 @@ class SimpleHg(BaseVCSController): #====================================================================== try: str_repo_name = environ['REPO_NAME'] = self.__get_repository(environ) - assert isinstance(str_repo_name, str) + assert isinstance(str_repo_name, str), str_repo_name repo_name = safe_unicode(str_repo_name) assert safe_str(repo_name) == str_repo_name, (str_repo_name, repo_name) log.debug('Extracted repo name is %s', repo_name) diff --git a/kallithea/templates/about.html b/kallithea/templates/about.html --- a/kallithea/templates/about.html +++ b/kallithea/templates/about.html @@ -40,9 +40,11 @@
  • Copyright © 2015–2016, Søren Løvborg
  • Copyright © 2016, Angel Ezquerra
  • Copyright © 2016, Asterios Dimitriou
  • +
  • Copyright © 2016, Kateryna Musina
  • Copyright © 2016, Konstantin Veretennicov
  • Copyright © 2016, Oscar Curero
  • Copyright © 2016, Robert James Dennington
  • +
  • Copyright © 2016, timeless@gmail.com
  • Copyright © 2016, YFdyh000
  • Copyright © 2012–2013, 2015, Aras Pranckevičius
  • Copyright © 2014–2015, Christian Oyarzun
  • diff --git a/kallithea/tests/functional/test_admin_repos.py b/kallithea/tests/functional/test_admin_repos.py --- a/kallithea/tests/functional/test_admin_repos.py +++ b/kallithea/tests/functional/test_admin_repos.py @@ -4,6 +4,8 @@ import os import mock import urllib +import pytest + from kallithea.lib import vcs from kallithea.lib.utils2 import safe_str, safe_unicode from kallithea.model.db import Repository, RepoGroup, UserRepoToPerm, User, \ @@ -594,6 +596,7 @@ class _BaseTestCase(TestController): # repo must not be in filesystem ! assert not os.path.isdir(os.path.join(Ui.get_by_key('paths', '/').ui_value, repo_name)) + class TestAdminReposControllerGIT(_BaseTestCase): REPO = GIT_REPO REPO_TYPE = 'git' @@ -608,3 +611,8 @@ class TestAdminReposControllerHG(_BaseTe NEW_REPO = NEW_HG_REPO OTHER_TYPE_REPO = GIT_REPO OTHER_TYPE = 'git' + + def test_permanent_url_protocol_access(self): + with pytest.raises(Exception) as e: + self.app.get(url('summary_home', repo_name='_1'), extra_environ={'HTTP_ACCEPT': 'application/mercurial'}) + assert 'Unable to detect pull/push action' in str(e)