Skip to content

Commit

Permalink
Allow more product endpoint names to be valid
Browse files Browse the repository at this point in the history
Product endpoint names can be started with digits or underscores.
  • Loading branch information
csordasmarton committed Apr 19, 2018
1 parent 3826b81 commit fc4d6b8
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 fc4d6b8

Please sign in to comment.