|
@@ -1,5 +1,6 @@
|
|
|
import urllib3
|
|
|
#requests doesnt work as it lacks key password checking
|
|
|
+import chardet
|
|
|
import json
|
|
|
|
|
|
|
|
@@ -39,6 +40,7 @@ class labkeyInterface:
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
|
def get(self,url):
|
|
|
|
|
@@ -93,7 +95,8 @@ class labkeyInterface:
|
|
|
url=self.GetLabkeyUrl()+'/login/whoAmI.view'
|
|
|
response=self.get(url)
|
|
|
self.cookie=response.getheader('Set-Cookie')
|
|
|
- jsonData=json.loads(response.data)
|
|
|
+ encoding=chardet.detect(response.data)['encoding']
|
|
|
+ jsonData=json.loads(response.data.decode(encoding))
|
|
|
return jsonData["CSRF"]
|
|
|
|
|
|
|