davecheney / httpstat

It's like curl -v, with colours.
MIT License
6.96k stars 382 forks source link

Add limiting for 30x redirects #54

Closed jrozner closed 7 years ago

jrozner commented 7 years ago

Implementation of issue #49 for limiting the maximum number of redirects allowed to follow.

davecheney commented 7 years ago

The test failure is my fault from merging #34. Please merge master and push again.

davecheney commented 7 years ago

I'm strongly opposed to making this a configurable constant. The users of this tool, people who want a kind of curl like thing that has a pretty coloured output, should be happy with a reasonable, opinionated, default value.

You suggested 50, I think 10 is reasonable. Please pick one and make it a constant.

Thank you.

jrozner commented 7 years ago

I understand the sane default, which currently exists and changing to 10 is fine (50 was only chosen because it was the default in cURL), but why remove functionality that offers no real additional complexity? The python version allows passing virtually all flags to cURL not part of the the tool which isn't possible with implementing this entirely in Go

davecheney commented 7 years ago

but why remove functionality that offers no real additional complexity

For the same rational as expressed here, https://github.com/davecheney/httpstat/issues/46#issuecomment-249411745

ble commented 7 years ago

I understand the desire to keep the interface simple; even though changing from a fixed default to an argument is could literally be a 1-line addition of code (flag.UintVar(&maxRedirects, "max-redirs", 10, "maximum number of redirects to follow if -L is set" e.g.), "one more argument" is a lot more complexity than "one more line of code".

davecheney commented 7 years ago

@ble I said no. I think the rational for wanting to limit the number of flags supported is reasonable.

davecheney commented 7 years ago

Thank you. I'll fix the merge conflicts and merge this now.