Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ patch ./vrchatapi/rest.py < ./patches/error_2fa_verify_readable.patch
patch ./vrchatapi/configuration.py < ./patches/safe_param_symbols.patch

# Boolean to lower str conversion for query parameters
patch ./vrchatapi/api_client.py < ./patches/query_param_bool.patch
patch ./vrchatapi/api_client.py < ./patches/query_param_bool.patch

# Add URL encoding to basic auth parameters
patch ./vrchatapi/configuration.py < ./patches/encode_basic_auth.patch
27 changes: 27 additions & 0 deletions patches/encode_basic_auth.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,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):
8 changes: 7 additions & 1 deletion vrchatapi/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import multiprocessing
import sys
import urllib3
import urllib.parse

import six
from six.moves import http_client as httplib
Expand Down Expand Up @@ -396,8 +397,13 @@ def get_basic_auth_token(self):
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):
Expand Down