docs: clean upload documentation

This commit is contained in:
Tom Boullay
2026-05-12 23:48:47 +02:00
parent 498765db61
commit 101af23418
6 changed files with 11 additions and 17 deletions
+1 -2
View File
@@ -2,8 +2,7 @@ import { timingSafeEqual } from 'crypto'
import { NextRequest, NextResponse } from 'next/server'
/**
* Validate the upload secret from request headers.
* Returns null if valid, or a NextResponse error if invalid.
* Validate the shared upload secret before accepting mutation routes.
*/
export function validateUploadSecret(req: NextRequest): NextResponse | null {
const secret = req.headers.get('x-upload-secret')
+1 -2
View File
@@ -7,8 +7,7 @@ const execFileAsync = promisify(execFile)
/**
* Compress a GLTF/GLB model using Blender's Draco compression.
* Returns { success: true } on success, or { success: false, error } on failure.
* GLB Draco is explicit: callers should fail instead of silently pushing heavy assets.
* Returns a structured result so callers can decide whether to fall back or stop.
*/
export async function compressWithBlender(
inputPath: string,
+1 -2
View File
@@ -1,8 +1,7 @@
import { basename } from 'path'
/**
* Sanitize a filename: strip path components, replace special chars,
* collapse underscores, lowercase.
* Normalize uploaded filenames before storing them or writing Git paths.
*/
export function sanitizeFilename(name: string): string {
return basename(name)