Skip to content

Commit 3aa72a9

Browse files
committed
dont sent bad limits to db
1 parent 26428df commit 3aa72a9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

coderd/workspaces.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,6 +1078,9 @@ func validWorkspaceSchedule(s *string, min time.Duration) (sql.NullString, error
10781078
// workspaceSearchQuery takes a query string and returns the workspace filter.
10791079
// It also can return the list of validation errors to return to the api.
10801080
func workspaceSearchQuery(query string, page codersdk.Pagination) (database.GetWorkspacesParams, []codersdk.ValidationError) {
1081+
if page.Limit < 1 {
1082+
page.Limit = 65536
1083+
}
10811084
filter := database.GetWorkspacesParams{
10821085
Offset: int32(page.Offset),
10831086
Limit: int32(page.Limit),

0 commit comments

Comments
 (0)