socketry / async-http

MIT License
320 stars 46 forks source link

Fix off-by-1 in RelativeLocation. #45

Closed BMorearty closed 4 years ago

BMorearty commented 4 years ago

The number of redirects allowed by the RelativeLocation class was off by one. A hop is a redirect, but if you passed in 0 hops it wasn't allowing even a single request. It should have allowed one request but no redirects.

Also changed the default maximum_hops from 4 to 3 to keep the default behavior consistent with what it was before.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 91.045% when pulling 19b6d20b5ed7b8f17a1ba75f438aaa70319588f2 on BMorearty:fix-redirect-off-by-1 into 7717fdbdc7995f70bf1d845489c45d7a47b0bafa on socketry:master.

ioquatix commented 4 years ago

Thanks, LGTM.