docs: clean upload documentation
This commit is contained in:
+1
-2
@@ -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
@@ -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
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user