Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Framework agnostic HTTP middleware to infer the proper MIME content type response header
Node.js/io.js HTTP server middleware to infer and define the proper MIME content type as response header
It is web framework agnostic and works properly in Connect, Express, Restify, Sails... among others
which implements the standard connect-based middleware interface: use(function (req, res, next) { ... })
It includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community. It uses node-mime
It was implemented specially for older Express/Connect versions which has no smart support for content type discovering
npm install mimeware --save
var express = require('express')
var mimeware = require('mimeware')
var app = express()
app.use(mimeware({ defaultType: 'text/html' }))
app.get('/hello', function (req, res, next) {
// respond with default type: text/html
res.send('Hello World!')
})
app.get('/hello.json', function (req, res, next) {
// respond with type: application/json
res.json({ say: 'Hello World!' })
})
app.get('/hello.xml', function (req, res, next) {
// respond with type: text/xml
res.send('<say>Hello World!</say>')
})
Type: string
Type: text/html
Define the default MIME type to use if cannot infer it
Type: array<string|regex>
An array of regex or string-like path patterns to ignore
Type: string
Default: utf-8
Define the default charset encoding type if cannot infer one.
Type: boolean
Default: true
Define the proper encoding charset if required
MIT © Tomas Aparicio
FAQs
Framework agnostic HTTP middleware to infer the proper MIME content type response header
The npm package mimeware receives a total of 9 weekly downloads. As such, mimeware popularity was classified as not popular.
We found that mimeware demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.