Introduces zod-based validation schemas for Minecraft and Mojang API endpoints. Refactors texture route to support hash-based file serving and removes the old static texture route. Updates database schema for player properties and adds an event to clean expired certificates. Improves ValidationError formatting, adjusts skin/cape URL construction, and adds SSRF protection for skin uploads.
16 lines
416 B
JavaScript
16 lines
416 B
JavaScript
const z = require("zod")
|
|
|
|
module.exports = {
|
|
GET: {
|
|
params: z.object({
|
|
uuid: z.string().length(32).regex(/^[0-9a-fA-F]+$/, { message: "Invalid UUID (no dashes expected)." })
|
|
}),
|
|
query: z.object({
|
|
unsigned: z.enum(["true", "false"]).optional()
|
|
}),
|
|
error: {
|
|
code: 204,
|
|
message: "No content (UUID not found)"
|
|
}
|
|
}
|
|
} |