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
I am using a relay server with RealtimeClient to add custom query parameters (e.g., jwtToken) for authentication. Here's the code snippet I used to append the parameter:
However, when I log the req.url on the relay server, the query parameters are not being sent correctly. It appears that RealtimeClient adds an additional query parameter (e.g., model) using a ? separator, even when the URL already contains a query string.
As a result, the generated WebSocket URL looks like this:
Create a RealtimeClient instance with a URL that already includes a query parameter (jwtToken).
Log the URL received by the WebSocket server (req.url) on the relay server.
Observe that the query parameters are malformed with multiple ?.
Summary
The current handling of query parameters in RealtimeClient causes malformed URLs when custom query strings are provided. Fixing this issue will make the library more robust and easier to integrate new query params to url
The text was updated successfully, but these errors were encountered:
I am using a relay server with
RealtimeClient
to add custom query parameters (e.g.,jwtToken
) for authentication. Here's the code snippet I used to append the parameter:However, when I log the
req.url
on the relay server, the query parameters are not being sent correctly. It appears thatRealtimeClient
adds an additional query parameter (e.g.,model
) using a?
separator, even when the URL already contains a query string.As a result, the generated WebSocket URL looks like this:
Instead of:
Expected Behavior
The
RealtimeClient
should correctly append additional query parameters using the&
separator when the URL already contains a query string.Example of the expected URL:
Actual Behavior
The
RealtimeClient
appends the additional query parameter using a second?
, resulting in an invalid query string:Steps to Reproduce
RealtimeClient
instance with a URL that already includes a query parameter (jwtToken
).req.url
) on the relay server.?
.Summary
The current handling of query parameters in
RealtimeClient
causes malformed URLs when custom query strings are provided. Fixing this issue will make the library more robust and easier to integrate new query params to urlThe text was updated successfully, but these errors were encountered: