File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 13
13
# been included. None of the administrative methods are implemented... yet.
14
14
15
15
__author__ = 'Jathan McCollum <jathan+bitbucket@gmail.com>'
16
- __version__ = '0.1.2 '
16
+ __version__ = '0.1.3 '
17
17
18
18
import urllib
19
19
import urllib2
@@ -111,7 +111,8 @@ def is_token_valid(self, tokenid):
111
111
params = {'tokenid' :tokenid }
112
112
data = self ._GET (REST_OPENSSO_IS_TOKEN_VALID , params )
113
113
114
- return data == 'boolean=true\r \n '
114
+ # 'boolean=true\r\n' or 'boolean=true\n'
115
+ return data .strip () == 'boolean=true'
115
116
116
117
def attributes (self , subjectid , attributes_names = 'uid' , ** kwargs ):
117
118
"""
@@ -148,7 +149,7 @@ def get_cookie_names_to_forward(self):
148
149
149
150
# Ditch the 'string=' crap and make into a list
150
151
cookie_string = data .replace ('string=' , '' )
151
- cookie_names = cookie_string .strip ().split ( ' \r \n ' )
152
+ cookie_names = cookie_string .strip ().splitlines ( )
152
153
153
154
return cookie_names
154
155
@@ -205,7 +206,7 @@ def _parse_token(data):
205
206
"""
206
207
Slice/split the token and return it. Exceptions will fall through.
207
208
"""
208
- # Server returns tokens as 'key=<value>\r\n'
209
+ # Server returns tokens as 'key=<value>\r\n' or 'key=<value>\n'
209
210
key , value = data .strip ().split ('=' , 1 )
210
211
return value
211
212
You can’t perform that action at this time.
0 commit comments