Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: reject malformed pagination params with 400 instead of silent fallback (#36855)

Evan0fe1b06d1ea0
diff --git a/api/controllers/service_api/dataset/segment.py b/api/controllers/service_api/dataset/segment.py
index ec060e89db3..e0c9a47eb4a 100644
--- a/api/controllers/service_api/dataset/segment.py
+++ b/api/controllers/service_api/dataset/segment.py
@@ -294,7 +294,6 @@ class SegmentApi(DatasetApiResource):
args = query_params_from_request(
SegmentListQuery,
list_fields=("status",),
- use_defaults_for_malformed_ints=True,
)
page = args.page
limit = min(args.limit, 100)
@@ -687,7 +686,7 @@ class ChildChunkApi(DatasetApiResource):
segment_id_str = str(segment_id)
_get_segment_for_document(session, dataset, document, segment_id_str)
- args = query_params_from_request(ChildChunkListQuery, use_defaults_for_malformed_ints=True)
+ args = query_params_from_request(ChildChunkListQuery)
page = args.page
limit = min(args.limit, 100)