-
Notifications
You must be signed in to change notification settings - Fork 12
Labels
type: bugSomething isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched the existing issues and added correct labels.
Description
Current Behavior
We do not validate header values we do fill. The possible issue is when unicode characters are used for e.g. machine name, in that case it crashes on headers fill.
Traceback
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<ayon-python-api>\ayon_api\server_api.py", line 1310, in login
response = self.post(
File "<ayon-python-api>\ayon_api\server_api.py", line 1483, in post
return self.raw_post(entrypoint, json=kwargs)
File "<ayon-python-api>\ayon_api\server_api.py", line 1440, in raw_post
return self._do_rest_request(
File "<ayon-python-api>\ayon_api\server_api.py", line 1371, in _do_rest_request
response = function(url, **kwargs)
File "<some-path>\lib\site-packages\requests\api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
File "<some-path>\lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
File "<some-path>\lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "<some-path>\lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "<some-path>\lib\site-packages\requests\adapters.py", line 667, in send
resp = conn.urlopen(
File "<some-path>\lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen
response = self._make_request(
File "<some-path>\lib\site-packages\urllib3\connectionpool.py", line 493, in _make_request
conn.request(
File "<some-path>\lib\site-packages\urllib3\connection.py", line 444, in request
self.putheader(header, value)
File "<some-path>\lib\site-packages\urllib3\connection.py", line 358, in putheader
super().putheader(header, *values)
File "<some-path>\lib\http\client.py", line 1258, in putheader
values[i] = one_value.encode('latin-1')
UnicodeEncodeError: 'latin-1' codec can't encode character '\u0161' in position 12: ordinal not in range(256)
Expected Behavior
We should use unidecode to convert machine name to 256 char set. Not sure what consequences that could have...
Steps To Reproduce:
Set machine name to contain one of characters ěščřžýá. Use login method on ayon api.
Additional context:
No response
Relevant log output:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type: bugSomething isn't workingSomething isn't working