Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: error on illegal page size #662

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions censys/cli/commands/asm.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,13 @@ def cli_execute_saved_query_by_name(args: argparse.Namespace):
sys.exit(1)
query = results[0]["query"]

if args.page_size > 1000:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, this looks like a great addition, maybe we can add this argument condition to before we fetch the saved query?

console.print(
"page size must be within [0,1000]. To fetch all pages, specify --pages -1 with any page size in range"
)

sys.exit(1)

try:
res = s.search(
None, query, args.page_size, None, args.sort, args.fields, args.pages
Expand Down
Loading