type-is
type-is copied to clipboard
Infer the content-type of a request.
[String.prototype.substr()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) is deprecated so we replace it with [String.prototype.slice()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/slice) which works similarily but isn't deprecated. .substr() probably isn't going away anytime soon but the change is trivial so it doesn't...
Support http2 to enable express tests with http2. expressjs/express#3390. `body-parser` cannot parse http2 body stream, because `hasBody` with `http2ServerRequest` always return false. A `http2ServerRequest` does not have any information about...
I'd love to use this package in the browser, but currently it uses Node-style CommonJS. Would it be possible to support ESM through package.json fields?
When I use koa and its `this.is('xml')`, it makes me confused: ``` js // content-type: 'text/xml' this.is('xml') // false ``` I think `application/xml` and `text/xml` are both valid `xml` type.
How about adding `javascript` as a new special shortcut that expands to the following. ``` javascript ['application/javascript', 'application/x-javascript', `text/javascript`] ``` Unfortunately there are still a few servers out in the...
We use vendor specific media types for all our resources and use versions to differentiate between breaking changes to that resource. For example: ``` application/vnd.linn.space-configuration+json; version=1 ``` is our current...
Currently, `type-is` fails to match the media-type of a request when the content-type header includes tabs. Minimal reproduction: ```javascript var http = require('http'); var typeis = require('type-is'); var server =...
Fixes issue #52. Notes: - The fix applies to both `typeis` and `typeis.is`, instead of just `typeis`. This is because `typeis.is` can receive a req-like or res-like object (this behaviour...
# Main Changes This pipeline will proactively report the status of the project (every day and when a push is done to `master` branch) including critical fields (`CI-Tests`, `Contributors`, `Dependency-Update-Tool`,...
This PR fixes the CI pipeline **Important** This is a BREAKING CHANGE. This PR drops Node.js 0.6 on the CI pipeline. Please check https://github.com/expressjs/express/issues/5643 which explains why we are doing...