File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed
Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -38,4 +38,7 @@ patch ./vrchatapi/rest.py < ./patches/error_2fa_verify_readable.patch
3838patch ./vrchatapi/configuration.py < ./patches/safe_param_symbols.patch
3939
4040# Boolean to lower str conversion for query parameters
41- patch ./vrchatapi/api_client.py < ./patches/query_param_bool.patch
41+ patch ./vrchatapi/api_client.py < ./patches/query_param_bool.patch
42+
43+ # Add URL encoding to basic auth parameters
44+ patch ./vrchatapi/configuration.py < ./patches/encode_basic_auth.patch
Original file line number Diff line number Diff line change 1+ diff --git a/vrchatapi/configuration.py b/vrchatapi/configuration.py
2+ index c0481ac4..45724ff1 100644
3+ --- a/vrchatapi/configuration.py
4+ +++ b/vrchatapi/configuration.py
5+ @@ -17,6 +17,7 @@ import logging
6+ import multiprocessing
7+ import sys
8+ import urllib3
9+ + import urllib.parse
10+
11+ import six
12+ from six.moves import http_client as httplib
13+ @@ -396,8 +397,13 @@ conf = vrchatapi.Configuration(
14+ password = ""
15+ if self.password is not None:
16+ password = self.password
17+ +
18+ + #URL encoding username/password to avoid issues with special characters
19+ + encoded_username = urllib.parse.quote(username)
20+ + encoded_password = urllib.parse.quote(password)
21+ +
22+ return urllib3.util.make_headers(
23+ - basic_auth=username + ':' + password
24+ + basic_auth=encoded_username + ':' + encoded_password
25+ ).get('authorization')
26+
27+ def auth_settings(self):
Original file line number Diff line number Diff line change 1717import multiprocessing
1818import sys
1919import urllib3
20+ import urllib .parse
2021
2122import six
2223from six .moves import http_client as httplib
@@ -396,8 +397,13 @@ def get_basic_auth_token(self):
396397 password = ""
397398 if self .password is not None :
398399 password = self .password
400+
401+ #URL encoding username/password to avoid issues with special characters
402+ encoded_username = urllib .parse .quote (username )
403+ encoded_password = urllib .parse .quote (password )
404+
399405 return urllib3 .util .make_headers (
400- basic_auth = username + ':' + password
406+ basic_auth = encoded_username + ':' + encoded_password
401407 ).get ('authorization' )
402408
403409 def auth_settings (self ):
You can’t perform that action at this time.
0 commit comments