2.0.4 • Published 1 year ago
@natlibfi/express-validate-content-type v2.0.4
Express.js middleware for validating content type

Express.js middleware for validating content type. Very simple but often sorely needed. Sends response with status code 415 (Unsupported Media Type) if content type doesn't match. Use Express's req.is behind the scenes.
Usage
ES modules
import validateContentType from '@natlibfi/express-validate-content-type';
app.post('/', validateContentType({type: 'application/json'}), (req, res) => {...});Node.js require
const {default: validateContentType} = require('@natlibfi/express-validate-content-type');
app.post('/', validateContentType({type: 'application/json'}), (req, res) => {...});License and copyright
Copyright (c) 2019, 2024-2025 University Of Helsinki (The National Library Of Finland)
This project's source code is licensed under the terms of MIT license
2.0.3-alpha.1
1 year ago
2.0.4-alpha.1
1 year ago
2.0.3
1 year ago
2.0.2
1 year ago
2.0.4
1 year ago
2.0.2-alpha.1
1 year ago
2.0.1-alpha.1
1 year ago
2.0.1
1 year ago
2.0.0-alpha.2
1 year ago
2.0.0
1 year ago
1.0.1
7 years ago
1.0.0
7 years ago