diff --git a/index.js b/index.js index 3c10453..684d4b9 100644 --- a/index.js +++ b/index.js @@ -50,7 +50,7 @@ class Router { * @property {Object} params Object containing all parameters defined in the url string * @property {Object} query Object containing all query parameters * @property {Object} headers Object containing request headers - * @property {Object|string} body Only available if method is `POST`, `PUT` or `PATCH`. Contains either the received body string or a parsed object if valid JSON was sent. + * @property {Object|string} body Only available if method is `POST`, `PUT`, `PATCH` or `DELETE`. Contains either the received body string or a parsed object if valid JSON was sent. */ /** @@ -313,7 +313,7 @@ class Router { status: this.corsConfig.optionsSuccessStatus }) } - if (['POST', 'PUT', 'PATCH'].includes(req.method)) { + if (['POST', 'PUT', 'PATCH', 'DELETE'].includes(req.method)) { if (req.headers.has('Content-Type') && req.headers.get('Content-Type').includes('json')) { try { req.body = await request.json()