Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tinyhttp/send

Package Overview
Dependencies
Maintainers
1
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tinyhttp/send - npm Package Compare versions

Comparing version 0.4.1 to 0.4.2

6

CHANGELOG.md
# @tinyhttp/send
## 0.4.2
### Patch Changes
- Fix some minor bugs for res.send
## 0.4.1

@@ -4,0 +10,0 @@

7

dist/index.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc