From dc1371d4d676e5cdbe28ee24666a0bd0aa6cc369 Mon Sep 17 00:00:00 2001 From: James Carr Date: Thu, 31 Jul 2014 00:02:03 +0100 Subject: [PATCH] Implemented --max-redirects option Added argument to argparse, changed client so that it uses a new requests Session() with the number of redirects and a single test to show the setting works. --- httpie/cli.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/httpie/cli.py b/httpie/cli.py index cd0c1775..db3159a4 100644 --- a/httpie/cli.py +++ b/httpie/cli.py @@ -380,6 +380,15 @@ sessions.add_argument( """ ) +sessions.add_argument( + '--max-redirects', + dest='redirects', + default=30, + help=""" + By default, requests has a limit of 30 redirects. + + """ +) ####################################################################### # Authentication