tus / tus-node-server

Node.js tus server, standalone or integrable in any framework, with disk, S3, Azure, and GGC stores.
https://tus.io/
MIT License
824 stars 201 forks source link

metdata example uses undefinded validateMetaData function #546

Closed dpmillerau closed 10 months ago

dpmillerau commented 10 months ago

The validateMetadata function referred to in this example code isn't defined!

**const {Server} = require('@tus/server') // ...

const server = new Server({ // .. async onUploadCreate(req, res, upload) { const {ok, expected, received} = validateMetadata(upload) if (!ok) { const body = Expected "${expected}" in "Upload-Metadata" but received "${received}" throw {status_code: 500, body} // if undefined, falls back to 500 with "Internal server error". } // We have to return the (modified) response. return res }, })**

Murderlon commented 10 months ago

Hi, it's pseudo-code to illustrate you could do something yourself, like a validateMetadata function or whatever.