mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-22 01:47:39 -07:00
[mastodon-client] Improve streaming api isMastodon check
This commit is contained in:
parent
878970d318
commit
a0adea70f5
1 changed files with 1 additions and 4 deletions
|
@ -53,10 +53,7 @@ export const initializeStreamingServer = (server: http.Server) => {
|
||||||
const host = `https://${request.host}`;
|
const host = `https://${request.host}`;
|
||||||
const prepareStream = q.stream?.toString();
|
const prepareStream = q.stream?.toString();
|
||||||
|
|
||||||
const isMastodon = request.resourceURL.pathname?.endsWith('/api/v1/streaming');
|
const isMastodon = request.resourceURL.pathname?.startsWith('/api/v1/streaming');
|
||||||
if (isMastodon && !request.resourceURL.pathname?.startsWith('/mastodon')) {
|
|
||||||
streamingLogger.warn(`Received connect from mastodon on incorrect path: ${request.resourceURL.pathname}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
const main = isMastodon
|
const main = isMastodon
|
||||||
? new MastodonStreamingConnection(connection, ev, user, app, q)
|
? new MastodonStreamingConnection(connection, ev, user, app, q)
|
||||||
|
|
Loading…
Reference in a new issue