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

Better error handling on -deny & -allow flags #371

Closed
nil0x42 opened this issue Aug 19, 2021 · 1 comment · Fixed by #376 or #370
Closed

Better error handling on -deny & -allow flags #371

nil0x42 opened this issue Aug 19, 2021 · 1 comment · Fixed by #376 or #370
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.

Comments

@nil0x42
Copy link

nil0x42 commented Aug 19, 2021

It's not clear on the doc what is the correct syntax for -allow & -deny flags.

For example, if i try:
echo http://localhost | httpx -json -probe -deny 127.0.0.0/8,10.0.0.0/8 | gron

httpx runs the query without error, even thought this comma-separated syntax is invalid

For it to work each CIDR must be added with a new -deny:
echo http://localhost | httpx -json -probe -deny 127.0.0.0/8 -deny 10.0.0.0/8 | gron

But unless the user takes time to launche a local webserv, and try syntax until it works, it's confusing because httpx doesn't fail when syntax is invalid.

I would expect an error like Invalid IP or CIDR: '127.0.0.0/8,10.0.0.0/8', so user is easily able to infer which is the correct syntax.

@ehsandeep ehsandeep added the Type: Enhancement Most issues will probably ask for additions or changes. label Aug 22, 2021
@ehsandeep ehsandeep linked a pull request Aug 24, 2021 that will close this issue
@ehsandeep ehsandeep added the Status: Completed Nothing further to be done with this issue. Awaiting to be closed. label Aug 24, 2021
@ehsandeep
Copy link
Member

ehsandeep commented Aug 24, 2021

@nil0x42 we have updated this feature support to allow comma separate multiple values or new line delimited file input as well.

For example:-

echo http://localhost | httpx -probe -deny 127.0.0.0/8,10.0.0.0/8,1.1.1.1
echo http://localhost | httpx -probe -allow 127.0.0.0/8,10.0.0.0/8,1.1.1.1
echo http://localhost | httpx -probe -allow allow-list.txt
echo http://localhost | httpx -probe -deny deny-list.txt

@ehsandeep ehsandeep linked a pull request Aug 24, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Enhancement Most issues will probably ask for additions or changes.
Projects
None yet
2 participants