forked from vrchatapi/vrchatapi-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathencode_basic_auth.patch
More file actions
27 lines (25 loc) 路 908 Bytes
/
Copy pathencode_basic_auth.patch
File metadata and controls
27 lines (25 loc) 路 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
diff --git a/vrchatapi/configuration.py b/vrchatapi/configuration.py
index c0481ac4..45724ff1 100644
--- a/vrchatapi/configuration.py
+++ b/vrchatapi/configuration.py
@@ -17,6 +17,7 @@ import logging
import multiprocessing
import sys
import urllib3
+import urllib.parse
import six
from six.moves import http_client as httplib
@@ -396,8 +397,13 @@ conf = vrchatapi.Configuration(
password = ""
if self.password is not None:
password = self.password
+
+ #URL encoding username/password to avoid issues with special characters
+ encoded_username = urllib.parse.quote(username)
+ encoded_password = urllib.parse.quote(password)
+
return urllib3.util.make_headers(
- basic_auth=username + ':' + password
+ basic_auth=encoded_username + ':' + encoded_password
).get('authorization')
def auth_settings(self):