From 42fe3e9cb0ef61b4e6fd64cb39b747df8492ebde Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Mon, 8 Jun 2015 14:19:02 -0400 Subject: [PATCH] Unable to login as desktop if you change the Content-type --- familysearch/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/familysearch/__init__.py b/familysearch/__init__.py index 4b2b62c..cd51af2 100644 --- a/familysearch/__init__.py +++ b/familysearch/__init__.py @@ -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)