mirror of
https://github.com/kmitresse/Compo-Service-Log-Project.git
synced 2026-05-13 17:11:49 +00:00
14 lines
362 B
TypeScript
14 lines
362 B
TypeScript
import { NextFunction, Request, Response } from "express";
|
|
|
|
export default function (req: Request, res: Response, next: NextFunction) {
|
|
if (req.is("application/xml")) {
|
|
let data = "";
|
|
req.setEncoding("utf8");
|
|
req.on("data", (chunk: any) => (data += chunk));
|
|
req.on("end", () => {
|
|
req.body = data;
|
|
next();
|
|
});
|
|
} else next();
|
|
}
|