Comparing version 8.0.3 to 8.0.4
@@ -8,2 +8,3 @@ // Native | ||
const typer = require('media-typer') | ||
const { readable } = require('is-stream') | ||
@@ -46,3 +47,3 @@ const { NODE_ENV } = process.env | ||
if (obj instanceof Stream) { | ||
if (obj instanceof Stream || readable(obj)) { | ||
if (!res.getHeader('Content-Type')) { | ||
@@ -49,0 +50,0 @@ res.setHeader('Content-Type', 'application/octet-stream') |
{ | ||
"name": "micro", | ||
"version": "8.0.3", | ||
"version": "8.0.4", | ||
"description": "Asynchronous HTTP microservices", | ||
@@ -59,2 +59,3 @@ "main": "./lib/index.js", | ||
"dependencies": { | ||
"is-stream": "1.1.0", | ||
"media-typer": "0.3.0", | ||
@@ -61,0 +62,0 @@ "mri": "1.1.0", |
@@ -187,3 +187,3 @@ <img src="https://raw.githubusercontent.com/zeit/art/6451bc300e00312d970527274f316f9b2c07a27e/micro/logo.png" width="50"/> | ||
- Use `require('micro').send`. | ||
- `statusCode` is a `Number` with the HTTP error code, and must always be supplied. | ||
- `statusCode` is a `Number` with the HTTP status code, and must always be supplied. | ||
- If `data` is supplied it is sent in the response. Different input types are processed appropriately, and `Content-Type` and `Content-Length` are automatically set. | ||
@@ -190,0 +190,0 @@ - `Stream`: `data` is piped as an `octet-stream`. Note: it is _your_ responsibility to handle the `error` event in this case (usually, simply logging the error and aborting the response is enough). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21889
257
4
+ Addedis-stream@1.1.0
+ Addedis-stream@1.1.0(transitive)