Commit b5366cba authored by Yeuoly's avatar Yeuoly Committed by takatost

fix: add max number array length

parent 6cfda369
...@@ -13,6 +13,7 @@ MAX_PRECISION = 20 ...@@ -13,6 +13,7 @@ MAX_PRECISION = 20
MAX_DEPTH = 5 MAX_DEPTH = 5
MAX_STRING_LENGTH = 1000 MAX_STRING_LENGTH = 1000
MAX_STRING_ARRAY_LENGTH = 30 MAX_STRING_ARRAY_LENGTH = 30
MAX_NUMBER_ARRAY_LENGTH = 1000
class CodeNode(BaseNode): class CodeNode(BaseNode):
_node_data_cls = CodeNodeData _node_data_cls = CodeNodeData
...@@ -210,6 +211,11 @@ class CodeNode(BaseNode): ...@@ -210,6 +211,11 @@ class CodeNode(BaseNode):
f'Output {prefix}.{output_name} is not an array, got {type(result.get(output_name))} instead.' f'Output {prefix}.{output_name} is not an array, got {type(result.get(output_name))} instead.'
) )
if len(result[output_name]) > MAX_NUMBER_ARRAY_LENGTH:
raise ValueError(
f'{prefix}.{output_name} in input form must be less than {MAX_NUMBER_ARRAY_LENGTH} characters'
)
transformed_result[output_name] = [ transformed_result[output_name] = [
self._check_number( self._check_number(
value=value, value=value,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment