You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The implementation to make requests in the SDK assumes an ascii encoding (meaning each character in the JSON string will map to 1 byte) but this is not always true.
Example request that fails when using the SDK but works using any other HTTP client (axios, curl, LR API docs, etc.):
POST https://api.loginradius.com/identity/v2/manage/account
The problem is that the "Content-Length" header is set using the length of the string and not the length of the byte array. For example, the word "José" has a length of 4 characters but it has a length of 5 bytes when turned into a byte array (buffer). That means that the SDK is incapable of sending that perfectly valid request to the LR API.
The change needed is rather simple (one line change) and I can create a PR if needed.
The text was updated successfully, but these errors were encountered:
The implementation to make requests in the SDK assumes an ascii encoding (meaning each character in the JSON string will map to 1 byte) but this is not always true.
Example request that fails when using the SDK but works using any other HTTP client (
axios
,curl
, LR API docs, etc.):POST https://api.loginradius.com/identity/v2/manage/account
The problem is that the "Content-Length" header is set using the length of the string and not the length of the byte array. For example, the word "José" has a length of 4 characters but it has a length of 5 bytes when turned into a byte array (buffer). That means that the SDK is incapable of sending that perfectly valid request to the LR API.
The change needed is rather simple (one line change) and I can create a PR if needed.
The text was updated successfully, but these errors were encountered: