1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-07 19:32:34 +01:00

fix attachment

This commit is contained in:
Flam3rboy 2021-07-18 19:51:19 +02:00
parent 4d7ce61ce5
commit 1754557af4
3 changed files with 50 additions and 1651 deletions

1698
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -31,7 +31,7 @@
"file-type": "^16.5.0",
"image-size": "^1.0.0",
"lambert-db": "^1.2.3",
"lambert-server": "^1.2.7",
"lambert-server": "^1.2.8",
"missing-native-js-functions": "^1.0.8",
"multer": "^1.4.2",
"node-fetch": "^2.6.1",

View File

@ -11,6 +11,7 @@ const router = Router();
router.post("/:channel_id", multer.single("file"), async (req: Request, res: Response) => {
if (req.headers.signature !== Config.get().security.requestSignature)
throw new HTTPError("Invalid request signature");
if (!req.file) return;
const { buffer, mimetype, size, originalname, fieldname } = req.file;
const { channel_id } = req.params;