mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2025-03-04 07:18:50 -07:00
allow finding compatibility endpoints
This commit is contained in:
parent
612ae420ec
commit
324784b355
1 changed files with 3 additions and 1 deletions
|
@ -5,6 +5,7 @@ import { AccessToken } from '@/models/entities/access-token.js';
|
|||
import { getIpHash } from '@/misc/get-ip-hash.js';
|
||||
import { limiter } from './limiter.js';
|
||||
import endpoints, { IEndpointMeta } from './endpoints.js';
|
||||
import compatibility from './compatibility.js';
|
||||
import { ApiError } from './error.js';
|
||||
import { apiLogger } from './logger.js';
|
||||
import { AccessToken } from '@/models/entities/access-token.js';
|
||||
|
@ -20,7 +21,8 @@ export default async (endpoint: string, user: CacheableLocalUser | null | undefi
|
|||
const isSecure = user != null && token == null;
|
||||
const isModerator = user != null && (user.isModerator || user.isAdmin);
|
||||
|
||||
const ep = endpoints.find(e => e.name === endpoint);
|
||||
const ep = endpoints.find(e => e.name === endpoint) ||
|
||||
compatibility.find(e => e.name === endpoint);
|
||||
|
||||
if (ep == null) {
|
||||
throw new ApiError({
|
||||
|
|
Loading…
Add table
Reference in a new issue