Skip to content

Commit

Permalink
Merge pull request #1530 from csordasmarton/fix-valid-product-endpoin…
Browse files Browse the repository at this point in the history
…t-names

Allow more product endpoint names to be valid
  • Loading branch information
gyorb authored May 2, 2018
2 parents 263e62b + fc4d6b8 commit a86d84f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
4 changes: 1 addition & 3 deletions libcodechecker/server/routing.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ def is_valid_product_endpoint(uripart):
if uripart in NON_PRODUCT_ENDPOINTS:
return False

# Like programming variables: begin with letter and then letters, numbers,
# underscores.
pattern = r'^[A-Za-z][A-Za-z0-9_]*$'
pattern = r'^[A-Za-z0-9_]+$'
if not re.match(pattern, uripart):
return False

Expand Down
8 changes: 0 additions & 8 deletions tests/functional/products/test_products.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,6 @@ def test_add_invalid_product(self):
)
product_cfg.connection = dbc

with self.assertRaises(RequestFailed):
product_cfg.endpoint = "_INVALID"
self._root_client.addProduct(product_cfg)

with self.assertRaises(RequestFailed):
product_cfg.endpoint = "0foobar"
self._root_client.addProduct(product_cfg)

with self.assertRaises(RequestFailed):
product_cfg.endpoint = "$$$$$$$"
self._root_client.addProduct(product_cfg)
Expand Down

0 comments on commit a86d84f

Please sign in to comment.