-
-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy pathlast_commit.txt
26 lines (15 loc) · 1.81 KB
/
last_commit.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Repository: plone.restapi
Branch: refs/heads/main
Date: 2025-01-14T17:48:13-08:00
Author: Dylan Jay (djay) <[email protected]>
Commit: https://github.com/plone/plone.restapi/commit/7af964916aa59cb38b33700198829b8372c1b4ea
Handle more BadRequests (#1857)
* Another should be BadRequest found in the wild
* add changelog
* Update news/1857.bugfix
---------
Co-authored-by: David Glick <[email protected]>
Files changed:
A news/1857.bugfix
M src/plone/restapi/services/querystringsearch/get.py
b'diff --git a/news/1857.bugfix b/news/1857.bugfix\nnew file mode 100644\nindex 0000000000..ea4ba7b398\n--- /dev/null\n+++ b/news/1857.bugfix\n@@ -0,0 +1 @@\n+Handle TypeError on querystringsearch as BadRequest. @djay\n\\ No newline at end of file\ndiff --git a/src/plone/restapi/services/querystringsearch/get.py b/src/plone/restapi/services/querystringsearch/get.py\nindex acd9f3647b..9b3c0e60c7 100644\n--- a/src/plone/restapi/services/querystringsearch/get.py\n+++ b/src/plone/restapi/services/querystringsearch/get.py\n@@ -33,17 +33,17 @@ def __call__(self):\n query = data.get("query", None)\n try:\n b_start = int(data.get("b_start", 0))\n- except ValueError:\n+ except (ValueError, TypeError):\n raise BadRequest("Invalid b_start")\n try:\n b_size = int(data.get("b_size", 25))\n- except ValueError:\n+ except (ValueError, TypeError):\n raise BadRequest("Invalid b_size")\n sort_on = data.get("sort_on", None)\n sort_order = data.get("sort_order", None)\n try:\n limit = int(data.get("limit", 1000))\n- except ValueError:\n+ except (ValueError, TypeError):\n raise BadRequest("Invalid limit")\n fullobjects = bool(data.get("fullobjects", False))\n \n'