From deb1955a3e7b01fb1ac2620e9cfae02ea7e1057b Mon Sep 17 00:00:00 2001 From: Ioannis Filippidis Date: Sat, 13 Sep 2014 14:18:48 -0700 Subject: [PATCH] add authorization to header only if specified by user --- bin/github-backup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/github-backup b/bin/github-backup index dbb93f7..5411ceb 100644 --- a/bin/github-backup +++ b/bin/github-backup @@ -127,7 +127,8 @@ def retrieve_data(args, template, query_args=None, single_request=False): }.items() + query_args.items())) request = urllib2.Request(template + '?' + querystring) - request.add_header('Authorization', 'Basic ' + auth) + if auth is not None: + request.add_header('Authorization', 'Basic ' + auth) r = urllib2.urlopen(request) errors = []