impl. auth ping
This commit is contained in:
parent
02fdcbcb82
commit
43e4d4cdf9
@ -14,9 +14,9 @@ class SeafileClient:
|
||||
def api_endpoint(self):
|
||||
return "%s/api2/" % self.server
|
||||
|
||||
def ping(self):
|
||||
def ping(self,auth=False):
|
||||
try:
|
||||
return self.session.get("%s/ping" % self.api_endpoint()).text == "\"pong\""
|
||||
return self.session.get("%s%s/ping" % (self.api_endpoint(),"/auth" if auth else "")).text == "\"pong\""
|
||||
except:
|
||||
return False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user