Skip to content

Commit 5616291

Browse files
author
Joel Collins
committed
Protect type values against semicolons
1 parent 3237226 commit 5616291

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

labthings/server/labthing.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ def __init__(
4747
self.endpoints = set()
4848

4949
self.url_prefix = prefix
50+
51+
for t in types:
52+
if ";" in t:
53+
raise ValueError(
54+
f'Error in type value "{t}". Thing types cannot contain ; character.'
55+
)
5056
self.types = types
57+
5158
self._description = description
5259
self._title = title
5360
self._version = version

0 commit comments

Comments
 (0)