1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-09 20:22:47 +01:00

Enforce RegEx no auth routes start

This commit is contained in:
TomatoCake 2024-08-30 14:49:27 +02:00
parent 03c050ae8b
commit 860e636c6e

View File

@ -32,7 +32,7 @@ export const NO_AUTHORIZATION_ROUTES = [
"POST /auth/reset", "POST /auth/reset",
"GET /invites/", "GET /invites/",
// Routes with a seperate auth system // Routes with a seperate auth system
/(POST|HEAD) \/webhooks\/\d+\/\w+\/?/, // no token requires auth /^(POST|HEAD) \/webhooks\/\d+\/\w+\/?/, // no token requires auth
// Public information endpoints // Public information endpoints
"GET /ping", "GET /ping",
"GET /gateway", "GET /gateway",
@ -51,11 +51,11 @@ export const NO_AUTHORIZATION_ROUTES = [
// Oauth callback // Oauth callback
"/oauth2/callback", "/oauth2/callback",
// Asset delivery // Asset delivery
/(GET|HEAD) \/guilds\/\d+\/widget\.(json|png)/, /^(GET|HEAD) \/guilds\/\d+\/widget\.(json|png)/,
// Connections // Connections
/(POST|HEAD) \/connections\/\w+\/callback/, /^(POST|HEAD) \/connections\/\w+\/callback/,
// Image proxy // Image proxy
/(GET|HEAD) \/imageproxy\/[A-Za-z0-9+/]\/\d+x\d+\/.+/, /^(GET|HEAD) \/imageproxy\/[A-Za-z0-9+/]\/\d+x\d+\/.+/,
]; ];
export const API_PREFIX = /^\/api(\/v\d+)?/; export const API_PREFIX = /^\/api(\/v\d+)?/;