mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
fix(streaming): req.scopes can be nullable (#16823)
When checking for required OAuth scopes, an unexpected error could happen due to missing (null-y) req.scopes. This commit fixes that by checking if req.scopes are present before checking if any required scopes are present, otherwise it skips that straight to rejection.
This commit is contained in:
parent
89b5071fde
commit
6c88ebfd4b
@ -430,7 +430,7 @@ const startWorker = (workerId) => {
|
||||
requiredScopes.push('read:statuses');
|
||||
}
|
||||
|
||||
if (requiredScopes.some(requiredScope => req.scopes.includes(requiredScope))) {
|
||||
if (req.scopes && requiredScopes.some(requiredScope => req.scopes.includes(requiredScope))) {
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user