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

status code option #519

Open
vanodevium opened this issue Apr 4, 2024 · 5 comments
Open

status code option #519

vanodevium opened this issue Apr 4, 2024 · 5 comments

Comments

@vanodevium
Copy link

Thanks for a great tool!

It would be very useful to be able to specify which status code I want to check.

For example, I check an endpoint that always returns 302, I specify it in the option and the tool isn't "afraid" that it is not 20x.

Something like:

autocannon -c 10 --status 302 https://domain.com/return/redirect
@mcollina
Copy link
Owner

How this would be different from --renderStatusCodes?

@vanodevium
Copy link
Author

In fact, there is no difference, except that a basic report on the status code I need will be enough for me, and not a table with all the statuses.

@mcollina
Copy link
Owner

Thanks for the clarification! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

@vanodevium
Copy link
Author

Of course, I'll try. And tests, 100%

@vanodevium
Copy link
Author

@mcollina

I'm sorry, but I couldn't do anything. Most likely, I just lack experience and that's why I couldn't.

The biggest problem is the non2xx calculation that is very difficult for me to change with dynamic codeIndex (it is in the printResult.js file)

non2xx: statusCodes[0] + statusCodes[2] + statusCodes[3] + statusCodes[4],

I really tried but failed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants