Allow for http type "OPTIONS"

This commit is contained in:
tomkat83 2015-12-27 13:56:07 +01:00
parent 4667e4ed64
commit 01f4833042
2 changed files with 14 additions and 1 deletions

View file

@ -213,6 +213,8 @@ class DownloadUtils():
r = s.post(url, json=postBody, timeout=timeout) r = s.post(url, json=postBody, timeout=timeout)
elif type == "DELETE": elif type == "DELETE":
r = s.delete(url, json=postBody, timeout=timeout) r = s.delete(url, json=postBody, timeout=timeout)
elif type == "OPTIONS":
r = s.options(url, json=postBody, timeout=timeout)
except AttributeError: except AttributeError:
# request session does not exists # request session does not exists
@ -260,6 +262,14 @@ class DownloadUtils():
cert=cert, cert=cert,
verify=verifyssl) verify=verifyssl)
elif type == "OPTIONS":
r = requests.options(url,
json=postBody,
headers=header,
timeout=timeout,
cert=cert,
verify=verifyssl)
# If user is not authenticated # If user is not authenticated
elif not authenticate: elif not authenticate:

View file

@ -182,6 +182,9 @@ class InitialSetup():
##### USER INFO ##### ##### USER INFO #####
self.logMsg("Getting user list.", 1) self.logMsg("Getting user list.", 1)
# If not multiple users, set username to Plex login name.
# If multiple users, get user list.
url = "%s/emby/Users/Public?format=json" % server url = "%s/emby/Users/Public?format=json" % server
result = self.doUtils.downloadUrl(url, authenticate=False) result = self.doUtils.downloadUrl(url, authenticate=False)