Update path matching regex to support dots
This commit is contained in:
parent
e699739b23
commit
c5fa12329c
3 changed files with 3 additions and 3 deletions
|
@ -20,7 +20,7 @@ logger = logging.getLogger(__name__)
|
|||
route_data = None
|
||||
|
||||
class RepoPathConverter(BaseConverter):
|
||||
regex = '[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+'
|
||||
regex = '[\.a-zA-Z0-9_\-]+/[\.a-zA-Z0-9_\-]+'
|
||||
weight = 200
|
||||
|
||||
app.url_map.converters['repopath'] = RepoPathConverter
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
<span style="color: #ccc">/</span>
|
||||
<span class="name-container">
|
||||
<input id="repoName" name="repoName" type="text" class="form-control" placeholder="Repository Name" ng-model="repo.name"
|
||||
required autofocus data-trigger="manual" data-content="{{ createError }}" data-placement="right" ng-pattern="/^[a-z0-9_-]+$/">
|
||||
required autofocus data-trigger="manual" data-content="{{ createError }}" data-placement="right" ng-pattern="/^[.a-z0-9_-]+$/">
|
||||
</span>
|
||||
<span class="alert alert-warning" ng-show="!newRepoForm.repoName.$error.required && !newRepoForm.repoName.$valid" style="margin-left: 10px;">
|
||||
Repository names must match [a-z0-9_-]+
|
||||
|
|
|
@ -771,7 +771,7 @@ class TestGetRepository(ApiTestCase):
|
|||
def test_getrepo_badnames(self):
|
||||
self.login(ADMIN_ACCESS_USER)
|
||||
|
||||
bad_names = ['logs', 'build', 'tokens']
|
||||
bad_names = ['logs', 'build', 'tokens', 'foo.bar', 'foo-bar', 'foo_bar']
|
||||
|
||||
# For each bad name, create the repo.
|
||||
for bad_name in bad_names:
|
||||
|
|
Reference in a new issue