Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Only conditionally set content-length on put

  • Loading branch information...
commit e654d1da1f787a14f79b3e01e288af211473ef02 1 parent f897ed4
Alex Clark aclark4life authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 githubcollective/github.py
6 githubcollective/github.py
View
@@ -27,15 +27,17 @@ def __init__(self, organization, username, password, verbose, pretend):
self.headers = {
'Authorization': 'Basic %s' % base64.encodestring(
'%s:%s' % (username, password)).replace('\n', ''),
- 'Content-Length': '0',
}
#
# requests library helpers
def _request(self, method, url, data=None):
+ headers = self.headers
+ if method.func_name == 'put':
+ headers['Content-Length'] = '0'
kw = {'url': BASE_URL + url + '?per_page=10000',
- 'headers': self.headers}
+ 'headers': headers}
if data:
kw['data'] = data
response = method(**kw)
Please sign in to comment.
Something went wrong with that request. Please try again.