@tinyhttp/send
Advanced tools
Comparing version 0.4.1 to 0.4.2
# @tinyhttp/send | ||
## 0.4.2 | ||
### Patch Changes | ||
- Fix some minor bugs for res.send | ||
## 0.4.1 | ||
@@ -4,0 +10,0 @@ |
@@ -67,3 +67,3 @@ import { format, parse } from 'es-content-type'; | ||
let etag; | ||
if (!res.getHeader('etag') && (etag = createETag(bodyToSend, encoding))) { | ||
if (body && !res.getHeader('etag') && (etag = createETag(bodyToSend, encoding))) { | ||
res.setHeader('etag', etag); | ||
@@ -80,6 +80,9 @@ } | ||
res.end(''); | ||
return; | ||
} | ||
if (typeof body === 'object') { | ||
if (body === null) { | ||
if (body == null) { | ||
console.log('here'); | ||
res.end(''); | ||
return; | ||
} | ||
@@ -86,0 +89,0 @@ else if (Buffer.isBuffer(body)) { |
{ | ||
"name": "@tinyhttp/send", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "json, send, sendFile, status and sendStatus methods for tinyhttp", |
@@ -40,3 +40,3 @@ import { IncomingMessage as I, ServerResponse as S } from 'http' | ||
let etag: string | undefined | ||
if (!res.getHeader('etag') && (etag = createETag(bodyToSend, encoding))) { | ||
if (body && !res.getHeader('etag') && (etag = createETag(bodyToSend, encoding))) { | ||
res.setHeader('etag', etag) | ||
@@ -55,7 +55,10 @@ } | ||
res.end('') | ||
return | ||
} | ||
if (typeof body === 'object') { | ||
if (body === null) { | ||
if (body == null) { | ||
console.log('here') | ||
res.end('') | ||
return | ||
} else if (Buffer.isBuffer(body)) { | ||
@@ -62,0 +65,0 @@ if (!res.getHeader('Content-Type')) { |
Sorry, the diff of this file is not supported yet
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
26887
578