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

send-data

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

send-data - npm Package Compare versions

Comparing version 3.2.5 to 3.3.0

plain.js

2

package.json
{
"name": "send-data",
"version": "3.2.5",
"version": "3.3.0",
"description": "send data through response",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -6,2 +6,3 @@ var test = require("tape")

var sendHtml = require("../html")
var sendPlain = require("../plain")

@@ -40,2 +41,10 @@ testServer(handleRequest, startTest)

sendHtml(req, res, "<div>foo</div>")
} else if (req.url === "/plain") {
sendPlain(req, res, {
body: "OK",
statusCode: 200,
headers: {}
})
} else if (req.url === "/plain/optional") {
sendPlain(req, res, "OK")
}

@@ -108,3 +117,23 @@ }

test("plain", function (t) {
request("/plain", function (err, res, body) {
t.equal(body, "OK")
t.equal(res.statusCode, 200)
t.equal(res.headers["content-type"], "text/plain; charset=utf-8")
t.end()
})
})
test("plain-optional", function (t) {
request("/plain/optional", function (err, res, body) {
t.equal(body, "OK")
t.equal(res.statusCode, 200)
t.equal(res.headers["content-type"], "text/plain; charset=utf-8")
t.end()
})
})
.on("end", done)
}
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