Skip to content

Commit

Permalink
Merge pull request #36 from dsblank/master
Browse files Browse the repository at this point in the history
Unable to login as desktop if you change the Content-type
  • Loading branch information
elderamevans committed Jun 8, 2015
2 parents a32634e + 42fe3e9 commit 75f1a12
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions familysearch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,10 @@ def _request(self, url, data=None, headers=None, method=None, nojson=False):
pass
request = Request(url, data, headers, method=method)
if not nojson:
if method is not "GET":
request.add_header('Content-Type', 'application/x-fs-v1+json')
request.add_header('Accept', 'application/json')
if method is not "GET" and "Content-type" not in request.headers:
request.add_header('Content-type', 'application/x-fs-v1+json')
if 'Accept' not in request.headers:
request.add_header('Accept', 'application/json')
if self.logged_in and not self.cookies:
# Add sessionId parameter to url if cookie is not set
request.add_header('Authorization', 'Bearer ' + self.access_token)
Expand Down

0 comments on commit 75f1a12

Please sign in to comment.