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

Maybe mishandling error cases? #5

Closed
peterbourgon opened this issue Aug 18, 2013 · 1 comment
Closed

Maybe mishandling error cases? #5

peterbourgon opened this issue Aug 18, 2013 · 1 comment

Comments

@peterbourgon
Copy link
Contributor

https://github.com/tsenart/vegeta/blob/master/lib/attack.go#L62

if body, err := ioutil.ReadAll(r.Body); err != nil && result.code < 200 || result.code >= 300 {
    result.err = errors.New(string(body))
}

This will set result.err if err == nil and result.code == e.g. 301 (I think a false positive) and will not set result.err if err != nil and result.code < 300 (I think a false negative).

Maybe I misinterpret your goals here though.

@tsenart
Copy link
Owner

tsenart commented Aug 19, 2013

Nice catch. Thanks.

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