-
-
Notifications
You must be signed in to change notification settings - Fork 986
Closed
Description
In the docs under WebSocket > Parameters the required parameters/headers are incorrect:
- the
Authorizationheader is marked as required, but in reality you can also provide the user token in theSec-WebSocket-Protocolheader (which the documentation omits) as an alternative toAuthorization - the
access_tokenparam is marked as required, but in reality it is only needed if you don’t use either of the aforementioned headers (and maybe should be recommended against because some network stacks might log the full URL string to disk and leak the access token) - the
streamparam is marked as required, but it isn’t required in reality. You can instead open a “blank” websocket without any particular stream, and then send subscribe message(s) for the stream(s) you want over the websocket after it is open.
Lastly:
- The WebSocket protocol allows payloads to be sent as either plain text or binary, but the Mastodon documentation of the JSON subscribe/unsubscribe payloads doesn’t specify which it expects. In practice it only seems to accept plain text. This might not be obvious to client developers because some frameworks like Swift Foundation treat encoded JSON as binary data by default.
Metadata
Metadata
Assignees
Labels
No labels